{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12413","labels_url":"https://api.github.com/repos/golang/go/issues/12413/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12413/comments","events_url":"https://api.github.com/repos/golang/go/issues/12413/events","html_url":"https://github.com/golang/go/issues/12413","id":104061156,"number":12413,"title":"cmd/compile: \"invalid variable name x in type switch\", where x is a name of a constant","user":{"login":"o948","id":5085109,"avatar_url":"https://avatars.githubusercontent.com/u/5085109?v=3","gravatar_id":"","url":"https://api.github.com/users/o948","html_url":"https://github.com/o948","followers_url":"https://api.github.com/users/o948/followers","following_url":"https://api.github.com/users/o948/following{/other_user}","gists_url":"https://api.github.com/users/o948/gists{/gist_id}","starred_url":"https://api.github.com/users/o948/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o948/subscriptions","organizations_url":"https://api.github.com/users/o948/orgs","repos_url":"https://api.github.com/users/o948/repos","events_url":"https://api.github.com/users/o948/events{/privacy}","received_events_url":"https://api.github.com/users/o948/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/24","html_url":"https://github.com/golang/go/milestones/Go1.6","labels_url":"https://api.github.com/repos/golang/go/milestones/24/labels","id":1096159,"number":24,"title":"Go1.6","description":"","creator":{"login":"josharian","id":67496,"avatar_url":"https://avatars.githubusercontent.com/u/67496?v=3","gravatar_id":"","url":"https://api.github.com/users/josharian","html_url":"https://github.com/josharian","followers_url":"https://api.github.com/users/josharian/followers","following_url":"https://api.github.com/users/josharian/following{/other_user}","gists_url":"https://api.github.com/users/josharian/gists{/gist_id}","starred_url":"https://api.github.com/users/josharian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josharian/subscriptions","organizations_url":"https://api.github.com/users/josharian/orgs","repos_url":"https://api.github.com/users/josharian/repos","events_url":"https://api.github.com/users/josharian/events{/privacy}","received_events_url":"https://api.github.com/users/josharian/received_events","type":"User","site_admin":false},"open_issues":329,"closed_issues":180,"state":"open","created_at":"2015-05-05T02:39:06Z","updated_at":"2015-10-10T11:33:18Z","due_on":"2016-01-31T08:00:00Z","closed_at":null},"comments":2,"created_at":"2015-08-31T14:12:01Z","updated_at":"2015-10-10T20:04:06Z","closed_at":null,"body":"The following program fails to build (http://play.golang.org/p/qrVKDN_MDR):\r\n\r\n\tpackage main\r\n\r\n\tconst x = 42\r\n\r\n\tfunc main() {\r\n\t\tswitch x := interface{}(nil).(type) {\r\n\t\tdefault:\r\n\t\t\t_ = x\r\n\t\t}\r\n\t}\r\n\r\nwith the error message:\r\n\r\n\tprog.go:6: invalid variable name x in type switch\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/147121919","html_url":"https://github.com/golang/go/issues/12413#issuecomment-147121919","issue_url":"https://api.github.com/repos/golang/go/issues/12413","id":147121919,"user":{"login":"anthonycanino1","id":10179790,"avatar_url":"https://avatars.githubusercontent.com/u/10179790?v=3","gravatar_id":"","url":"https://api.github.com/users/anthonycanino1","html_url":"https://github.com/anthonycanino1","followers_url":"https://api.github.com/users/anthonycanino1/followers","following_url":"https://api.github.com/users/anthonycanino1/following{/other_user}","gists_url":"https://api.github.com/users/anthonycanino1/gists{/gist_id}","starred_url":"https://api.github.com/users/anthonycanino1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthonycanino1/subscriptions","organizations_url":"https://api.github.com/users/anthonycanino1/orgs","repos_url":"https://api.github.com/users/anthonycanino1/repos","events_url":"https://api.github.com/users/anthonycanino1/events{/privacy}","received_events_url":"https://api.github.com/users/anthonycanino1/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T20:04:06Z","updated_at":"2015-10-10T20:04:06Z","body":"Have an idea with what is wrong: Looks like x in the type switch grabs the const x symbol during parsing, which gives it the OLITERAL op that then errors in the type switch. Looking into a fix."}}