{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4788","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4788/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4788/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4788/events","html_url":"https://github.com/Microsoft/TypeScript/pull/4788","id":106428378,"number":4788,"title":"initial revision of reachability checks","user":{"login":"vladima","id":8052307,"avatar_url":"https://avatars.githubusercontent.com/u/8052307?v=3","gravatar_id":"","url":"https://api.github.com/users/vladima","html_url":"https://github.com/vladima","followers_url":"https://api.github.com/users/vladima/followers","following_url":"https://api.github.com/users/vladima/following{/other_user}","gists_url":"https://api.github.com/users/vladima/gists{/gist_id}","starred_url":"https://api.github.com/users/vladima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladima/subscriptions","organizations_url":"https://api.github.com/users/vladima/orgs","repos_url":"https://api.github.com/users/vladima/repos","events_url":"https://api.github.com/users/vladima/events{/privacy}","received_events_url":"https://api.github.com/users/vladima/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/cla-not-required","name":"cla-not-required","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-14T21:07:34Z","updated_at":"2015-09-22T17:15:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/4788","html_url":"https://github.com/Microsoft/TypeScript/pull/4788","diff_url":"https://github.com/Microsoft/TypeScript/pull/4788.diff","patch_url":"https://github.com/Microsoft/TypeScript/pull/4788.patch"},"body":"this PR supersedes #1287.\r\nChecking unreachable code in the compiler uncovered 2 bugs, both of the same origin:\r\n```ts\r\nfunction foo() {\r\n    return bar; // at this point x cannot be used yet because of TDZ\r\n    let x: number; \r\n    function bar() {\r\n        if (!x) x = 0;\r\n        return ++x;\r\n    }\r\n}\r\n```\r\n\r\nCurrently reachability checks are placed in binder but ultimately I'd like to be separate actions that are executed on the same pass - split walking and processing logic"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/142353314","html_url":"https://github.com/Microsoft/TypeScript/pull/4788#issuecomment-142353314","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4788","id":142353314,"user":{"login":"vladima","id":8052307,"avatar_url":"https://avatars.githubusercontent.com/u/8052307?v=3","gravatar_id":"","url":"https://api.github.com/users/vladima","html_url":"https://github.com/vladima","followers_url":"https://api.github.com/users/vladima/followers","following_url":"https://api.github.com/users/vladima/following{/other_user}","gists_url":"https://api.github.com/users/vladima/gists{/gist_id}","starred_url":"https://api.github.com/users/vladima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladima/subscriptions","organizations_url":"https://api.github.com/users/vladima/orgs","repos_url":"https://api.github.com/users/vladima/repos","events_url":"https://api.github.com/users/vladima/events{/privacy}","received_events_url":"https://api.github.com/users/vladima/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T17:15:37Z","updated_at":"2015-09-22T17:15:37Z","body":"different checks are enabled via command line options. Perf impact is pretty much negligible since it is incorporated in the pass over tree that binder have to do anyways (in the future perspective this step have to be redesigned to decouple actions from the walk since binder is slowly turning into a monster)"}}