Closed
Description
TypeScript Version: 2.3.1
Code
declare let p: Promise<void>;
declare let p2: Promise<string>;
let p3 = p.then(() => Math.random() ? 0 : p2);
Expected behavior:
Code is accepted and type of p3
is Promise<string|number>
.
Actual behavior:
Type Error: Argument of type '() => Promise<string> | 0' is not assignable to parameter of type '(value: void) => string | PromiseLike<string>'.