{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7768","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7768/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7768/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7768/events","html_url":"https://github.com/Microsoft/TypeScript/issues/7768","id":145231620,"number":7768,"title":"execution flow analysis disregards narrowing for primitives constants","user":{"login":"aleksey-bykov","id":937933,"avatar_url":"https://avatars.githubusercontent.com/u/937933?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksey-bykov","html_url":"https://github.com/aleksey-bykov","followers_url":"https://api.github.com/users/aleksey-bykov/followers","following_url":"https://api.github.com/users/aleksey-bykov/following{/other_user}","gists_url":"https://api.github.com/users/aleksey-bykov/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksey-bykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksey-bykov/subscriptions","organizations_url":"https://api.github.com/users/aleksey-bykov/orgs","repos_url":"https://api.github.com/users/aleksey-bykov/repos","events_url":"https://api.github.com/users/aleksey-bykov/events{/privacy}","received_events_url":"https://api.github.com/users/aleksey-bykov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Needs%20Proposal","name":"Needs Proposal","color":"556b75"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-01T17:00:50Z","updated_at":"2016-04-28T22:15:41Z","closed_at":"2016-04-28T22:15:41Z","body":"nightly build\r\n\r\n```\r\nconst x = Math.random() > 0.5 ? 'hey' : 1;\r\nif (typeof x === 'number') {\r\n\t[].map(() => x + 2); // expected should typecheck, actual no-no-no\r\n}\r\n```\r\n\r\nnumbers can't mutate, `x` holds a number, also it is a constant, constant can't change its value, so ..."}}