{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13086","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13086/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13086/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13086/events","html_url":"https://github.com/Microsoft/TypeScript/issues/13086","id":196868547,"number":13086,"title":"Flow analysis doesn't work with es6 collections 'has' method","user":{"login":"MastroLindus","id":17946082,"avatar_url":"https://avatars.githubusercontent.com/u/17946082?v=3","gravatar_id":"","url":"https://api.github.com/users/MastroLindus","html_url":"https://github.com/MastroLindus","followers_url":"https://api.github.com/users/MastroLindus/followers","following_url":"https://api.github.com/users/MastroLindus/following{/other_user}","gists_url":"https://api.github.com/users/MastroLindus/gists{/gist_id}","starred_url":"https://api.github.com/users/MastroLindus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MastroLindus/subscriptions","organizations_url":"https://api.github.com/users/MastroLindus/orgs","repos_url":"https://api.github.com/users/MastroLindus/repos","events_url":"https://api.github.com/users/MastroLindus/events{/privacy}","received_events_url":"https://api.github.com/users/MastroLindus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-21T07:56:33Z","updated_at":"2016-12-21T08:08:26Z","closed_at":null,"body":"**TypeScript Version:**  2.1.1 \r\n\r\n**Code**\r\n\r\n```ts\r\nconst x = new Map<string, string>();\r\nx.set(\"key\", \"value\");\r\nif (x.has(\"key\")) {\r\n  const y : string = x.get(\"key\");  // error: y is string | undefined, not string\r\n}\r\n\r\n\r\n```\r\n\r\n**Expected behavior:**\r\ny is narrowed down to string\r\n**Actual behavior:**\r\ny is still string | undefined even after checking if the map has that key"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/268461298","html_url":"https://github.com/Microsoft/TypeScript/issues/13086#issuecomment-268461298","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13086","id":268461298,"user":{"login":"arusakov","id":3473150,"avatar_url":"https://avatars.githubusercontent.com/u/3473150?v=3","gravatar_id":"","url":"https://api.github.com/users/arusakov","html_url":"https://github.com/arusakov","followers_url":"https://api.github.com/users/arusakov/followers","following_url":"https://api.github.com/users/arusakov/following{/other_user}","gists_url":"https://api.github.com/users/arusakov/gists{/gist_id}","starred_url":"https://api.github.com/users/arusakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arusakov/subscriptions","organizations_url":"https://api.github.com/users/arusakov/orgs","repos_url":"https://api.github.com/users/arusakov/repos","events_url":"https://api.github.com/users/arusakov/events{/privacy}","received_events_url":"https://api.github.com/users/arusakov/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T08:08:26Z","updated_at":"2016-12-21T08:08:26Z","body":"You can workaround this by using:\r\n```\r\nconst y = x.get('key');\r\nif (y) {\r\n  // y is string here\r\n}\r\n```"}}
{"actor":{"display_login":"arusakov"}}