Closed
Description
TypeScript Version: 3.7.x-dev.201xxxxx
Search Terms:
Code
interface A {
a: number
}
interface B {
b: number
}
function func(b: B): void {
console.log(b.b)
}
async function as_a(): Promise<A | undefined> {
return {a: 10}
}
async function as_b(): Promise<B> {
return {b: 3}
}
autoExec()
async function autoExec() {
const [t1, t2] = await Promise.all([as_a(), as_b()])
func(t2)
}
Expected behavior:
Works correctly in typescript 3.6.4, but failed to compile in typescript@latest and typescript@next with error Argument of type 'B | undefined' is not assignable to parameter of type 'B'.