Closed
Description
TypeScript Version: 3.6.0-dev
Code
declare function foo<T>(x: T | Promise<T>): void;
declare let x: false | Promise<true>;
foo(x); // Error, 'false | Promise<true>' not assignable to 'true | Promise<true>'
declare function bar<T>(x: T, y: string | T): T;
const y = bar(1, 2); // Error, '2' not assignable to 'string | 1'
Expected behavior: No errors.
Actual behavior: Errors as noted above.
Related Issues: Discovered in #32386.