Conditional Types and Narrowing Type Fail to Return #22628
Labels
Suggestion
An idea for TypeScript
Too Complex
An issue which adding support for may be too complex for the value it adds
TypeScript Version: 2.8-rc
Search Terms:
typescript Conditional Types narrow type primitive union
Code
Expected behavior:
To be able to return the narrowed type from the union and have the compiler not mentioning that the returned type is not assignable the type that has conditional type.
Actual behavior:
The compiler produce this error:
The generated JavaScript is good.
Playground Link:
Link
The text was updated successfully, but these errors were encountered: