{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19918","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19918/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19918/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/19918/events","html_url":"https://github.com/Microsoft/TypeScript/issues/19918","id":273023333,"number":19918,"title":"awaiting a Promise recasts top variable to initial type","user":{"login":"bondz","id":4683867,"avatar_url":"https://avatars3.githubusercontent.com/u/4683867?v=4","gravatar_id":"","url":"https://api.github.com/users/bondz","html_url":"https://github.com/bondz","followers_url":"https://api.github.com/users/bondz/followers","following_url":"https://api.github.com/users/bondz/following{/other_user}","gists_url":"https://api.github.com/users/bondz/gists{/gist_id}","starred_url":"https://api.github.com/users/bondz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bondz/subscriptions","organizations_url":"https://api.github.com/users/bondz/orgs","repos_url":"https://api.github.com/users/bondz/repos","events_url":"https://api.github.com/users/bondz/events{/privacy}","received_events_url":"https://api.github.com/users/bondz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-10T18:41:26Z","updated_at":"2017-11-10T18:41:26Z","closed_at":null,"author_association":"NONE","body":"```ts\r\nfunction test(a: boolean): false | Date {\r\n    if (a) {\r\n        return new Date();\r\n    }\r\n\r\n    return false;\r\n}\r\n\r\n\r\nasync function test2() {\r\n    let b = test(true);\r\n\r\n    if (!b) {\r\n        b = new Date();\r\n    }\r\n    \r\n    await Promise.all([]).then(() => {\r\n        b.getDate(); //Should compile.\r\n            \r\n    })\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nShould compile\r\n**Actual behavior:**\r\nThrows with `Property 'getDate' does not exist on type 'true'.`"}}
{"actor":{"display_login":"bondz"}}