Closed
Description
TS 2.0.3
new Promise<string>(resolve => {
true ? resolve('foo') : resolve()
})
This returns a Promise<string>
, however it is possible to call resolve
with no value, meaning the return type is actually Promise<string | undefined>
at runtime.
I'm not sure whether the return type should in fact be inferred as Promise<string | undefined>
or whether the empty resolve()
call should throw a compile error.