=== tests/cases/compiler/awaitUnionPromise.ts === // https://github.com/Microsoft/TypeScript/issues/18186 class AsyncEnumeratorDone { }; >AsyncEnumeratorDone : AsyncEnumeratorDone interface IAsyncEnumerator { next1(): Promise; >next1 : () => Promise next2(): Promise | Promise; >next2 : () => Promise | Promise next3(): Promise; >next3 : () => Promise next4(): Promise; >next4 : () => Promise >x : string } async function main() { >main : () => Promise const x: IAsyncEnumerator = null; >x : IAsyncEnumerator >null : null let a = await x.next1(); >a : number | AsyncEnumeratorDone >await x.next1() : number | AsyncEnumeratorDone >x.next1() : Promise >x.next1 : () => Promise >x : IAsyncEnumerator >next1 : () => Promise let b = await x.next2(); >b : number | AsyncEnumeratorDone >await x.next2() : number | AsyncEnumeratorDone >x.next2() : Promise | Promise >x.next2 : () => Promise | Promise >x : IAsyncEnumerator >next2 : () => Promise | Promise let c = await x.next3(); >c : number | {} >await x.next3() : number | {} >x.next3() : Promise >x.next3 : () => Promise >x : IAsyncEnumerator >next3 : () => Promise let d = await x.next4(); >d : number | { x: string; } >await x.next4() : number | { x: string; } >x.next4() : Promise >x.next4 : () => Promise >x : IAsyncEnumerator >next4 : () => Promise }