TypeScript Version: 3.4.2
Search Terms:
conditional type
Code
OK
typeF<X>=<T>()=>TextendsX ? 1 : 2;declareconstx: F<any>;consty: F<number>=x;
Error
declareconstx: <T>()=>Textendsany ? 1 : 2;consty: <T>()=>Textendsnumber ? 1 : 2=x;
Expected behavior:
The two codes do the same thing
Actual behavior:
Different behavior
Playground Link:
Related Issues:
TypeScript Version: 3.4.2
Search Terms:
conditional typeCode
OK
Error
Expected behavior:
The two codes do the same thing
Actual behavior:
Different behavior
Playground Link:
Related Issues: