{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/11062","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/11062/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/11062/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/11062/events","html_url":"https://github.com/Microsoft/TypeScript/issues/11062","id":178673274,"number":11062,"title":"Inconsistent Treatment of Shorthand Functions","user":{"login":"ChrisGrohHS","id":10550535,"avatar_url":"https://avatars.githubusercontent.com/u/10550535?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisGrohHS","html_url":"https://github.com/ChrisGrohHS","followers_url":"https://api.github.com/users/ChrisGrohHS/followers","following_url":"https://api.github.com/users/ChrisGrohHS/following{/other_user}","gists_url":"https://api.github.com/users/ChrisGrohHS/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisGrohHS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisGrohHS/subscriptions","organizations_url":"https://api.github.com/users/ChrisGrohHS/orgs","repos_url":"https://api.github.com/users/ChrisGrohHS/repos","events_url":"https://api.github.com/users/ChrisGrohHS/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisGrohHS/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-22T17:35:49Z","updated_at":"2016-09-22T17:41:37Z","closed_at":"2016-09-22T17:41:37Z","body":"<!-- BUGS: Please use this template. -->\r\n<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:**  2.0.3\r\n\r\n**Code**\r\n\r\n```ts\r\n// A *self-contained* demonstration of the problem follows...\r\nfunction testFunction(x: string | Function): any {\r\n    if (typeof x === 'string') {\r\n        return {\r\n            key: function (a: any, b: any) {\r\n                // Fine, x is string\r\n                return a[x];\r\n            }\r\n        };\r\n        return {\r\n            key(a: any, b: any) {\r\n                // Fails, x is string | Function here\r\n                return a[x];\r\n            }\r\n        };\r\n    }\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nCompiles fine\r\n\r\n**Actual behavior:** \r\nError: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'."}}
{"actor":{"display_login":"mhegazy"}}