{"action":"created","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/1225","labels_url":"https://api.github.com/repos/manastech/crystal/issues/1225/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/1225/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/1225/events","html_url":"https://github.com/manastech/crystal/issues/1225","id":101786293,"number":1225,"title":"Macro variable issue","user":{"login":"stugol","id":1113153,"avatar_url":"https://avatars.githubusercontent.com/u/1113153?v=3","gravatar_id":"","url":"https://api.github.com/users/stugol","html_url":"https://github.com/stugol","followers_url":"https://api.github.com/users/stugol/followers","following_url":"https://api.github.com/users/stugol/following{/other_user}","gists_url":"https://api.github.com/users/stugol/gists{/gist_id}","starred_url":"https://api.github.com/users/stugol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stugol/subscriptions","organizations_url":"https://api.github.com/users/stugol/orgs","repos_url":"https://api.github.com/users/stugol/repos","events_url":"https://api.github.com/users/stugol/events{/privacy}","received_events_url":"https://api.github.com/users/stugol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-08-19T01:36:29Z","updated_at":"2015-08-19T16:41:29Z","closed_at":null,"body":"The code at http://play.crystal-lang.org/#/r/bxb causes the error ```undefined local variable or method```.\r\n\r\nAs there appears to be no way to explicitly constrain a variable's type (```a :: Int32```) and also provide an initialisation value (```a = 4```) at the same time, I figured this macro would help.\r\n\r\nIt works for instance variables, but not locals, and I don't understand why."},"comment":{"url":"https://api.github.com/repos/manastech/crystal/issues/comments/132689572","html_url":"https://github.com/manastech/crystal/issues/1225#issuecomment-132689572","issue_url":"https://api.github.com/repos/manastech/crystal/issues/1225","id":132689572,"user":{"login":"bjmllr","id":3877651,"avatar_url":"https://avatars.githubusercontent.com/u/3877651?v=3","gravatar_id":"","url":"https://api.github.com/users/bjmllr","html_url":"https://github.com/bjmllr","followers_url":"https://api.github.com/users/bjmllr/followers","following_url":"https://api.github.com/users/bjmllr/following{/other_user}","gists_url":"https://api.github.com/users/bjmllr/gists{/gist_id}","starred_url":"https://api.github.com/users/bjmllr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjmllr/subscriptions","organizations_url":"https://api.github.com/users/bjmllr/orgs","repos_url":"https://api.github.com/users/bjmllr/repos","events_url":"https://api.github.com/users/bjmllr/events{/privacy}","received_events_url":"https://api.github.com/users/bjmllr/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T16:41:29Z","updated_at":"2015-08-19T16:41:29Z","body":"Then what about a cast? `a = 2_147_483_648 as Int32` has pretty much the same effect as far as I can tell."}}