-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
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.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue