Closed
Description
TypeScript Version: 3.4.2
Search Terms:
conditional type
Code
OK
type F<X> = <T>() => T extends X ? 1 : 2;
declare const x: F<any>;
const y: F<number> = x;
Error
declare const x: <T>() => T extends any ? 1 : 2;
const y: <T>() => T extends number ? 1 : 2 = x;
Expected behavior:
The two codes do the same thing
Actual behavior:
Different behavior
Playground Link:
Related Issues: