{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9493","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9493/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9493/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9493/events","html_url":"https://github.com/Microsoft/TypeScript/issues/9493","id":163529856,"number":9493,"title":"Recursive function variable","user":{"login":"frogcjn","id":1777562,"avatar_url":"https://avatars.githubusercontent.com/u/1777562?v=3","gravatar_id":"","url":"https://api.github.com/users/frogcjn","html_url":"https://github.com/frogcjn","followers_url":"https://api.github.com/users/frogcjn/followers","following_url":"https://api.github.com/users/frogcjn/following{/other_user}","gists_url":"https://api.github.com/users/frogcjn/gists{/gist_id}","starred_url":"https://api.github.com/users/frogcjn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frogcjn/subscriptions","organizations_url":"https://api.github.com/users/frogcjn/orgs","repos_url":"https://api.github.com/users/frogcjn/repos","events_url":"https://api.github.com/users/frogcjn/events{/privacy}","received_events_url":"https://api.github.com/users/frogcjn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-02T18:11:57Z","updated_at":"2016-07-02T18:11:57Z","closed_at":null,"body":"with typescript-2.0.0-dev.20160702\r\n\r\n```typescript\r\nconst clone = function(obj: any) {\r\n    switch (typeof obj) {\r\n    case \"object\":\r\n        copy = {}\r\n        for (const name of Object.getOwnPropertyNames(obj)) {\r\n            copy[name] = clone(obj[name])\r\n        }\r\n        break\r\n    case \"function\":\r\n        return\r\n    default:\r\n        copy = obj\r\n        break\r\n    }\r\n\r\n    return copy\r\n}\r\n```\r\nwill trigger error:\r\n```\r\n\u001B[100;30m11             copy[name] = clone(obj[name])\r\n\u001B[100;30m                            ~~~~~\r\nsrc/modules/clone.ts(11,26): error TS2454: Variable 'clone' is used before being assigned.\r\n```\r\n\r\nThis error will not be triggered using old version of typescript.\r\nIs this a bug?\r\n\r\nand \r\n```typescript\r\nfunction clone(obj: any) {\r\n...\r\n```\r\nwill not trigger error both in  typescript-2.0.0-dev.20160702 and older version.\r\n"}}
{"actor":{"display_login":"frogcjn"}}