{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7094","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7094/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7094/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7094/events","html_url":"https://github.com/Microsoft/TypeScript/issues/7094","id":134010774,"number":7094,"title":"Precedence in parsing types","user":{"login":"elbarzil","id":16406475,"avatar_url":"https://avatars.githubusercontent.com/u/16406475?v=3","gravatar_id":"","url":"https://api.github.com/users/elbarzil","html_url":"https://github.com/elbarzil","followers_url":"https://api.github.com/users/elbarzil/followers","following_url":"https://api.github.com/users/elbarzil/following{/other_user}","gists_url":"https://api.github.com/users/elbarzil/gists{/gist_id}","starred_url":"https://api.github.com/users/elbarzil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elbarzil/subscriptions","organizations_url":"https://api.github.com/users/elbarzil/orgs","repos_url":"https://api.github.com/users/elbarzil/repos","events_url":"https://api.github.com/users/elbarzil/events{/privacy}","received_events_url":"https://api.github.com/users/elbarzil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-16T15:28:43Z","updated_at":"2016-02-16T17:33:41Z","closed_at":null,"body":"It looks to me like this should parse, but it doesn't:\r\n\r\n    var x: number | (string)=>void;\r\n\r\nIt works with added parens:\r\n\r\n    var x: number | ((string)=>void);\r\n\r\nBut if the parser is not too hacky, then maybe it's easy to make the first work?\r\n\r\n(FWIW, I ran into this in a rest argument, where it would be nice to avoid the extra parens in\r\n\r\n    function foo(...xs: (number | ()=>void)[]): void { }\r\n\r\n)\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/184789231","html_url":"https://github.com/Microsoft/TypeScript/issues/7094#issuecomment-184789231","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7094","id":184789231,"user":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T17:33:41Z","updated_at":"2016-02-16T17:33:41Z","body":">  Is this described somewhere in the docs?\r\n\r\nIt's in the grammar. I don't think we have explicitly written down the precedence order anywhere.\r\n\r\n> And re the side note: is that new? I see that\r\n\r\nIt's been that way since forever. That declaration is for a callback that takes a parameter named `number` of the implicit type `any`. I'd recommend compiling with `--noImplicitAny` to find these."}}