Nested conditional types and generics, testing type equality evaluating to incorrect branch #37314
Labels
Fix Available
A PR has been opened for this issue
Needs Investigation
This issue needs a team member to investigate its status.
Rescheduled
This issue was previously scheduled to an earlier milestone
Milestone
TypeScript Version: 3.5.1, 3.8.3
Search Terms:
conditional types, generics, equality
Code
strictNullChecks and strictFunctionTypes enabled
Expected behavior:
Evaluates to
0
Actual behavior:
Evaluates to
1
Playground Link: http://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=16&pc=1#code/FAUwHgDg9gTgLgAjgTwiBBRAjgVwIYA2AzgDwCCAjAuHCAHYAmRCedyANAmQEzVi2NmrZAD4EAXmAJpCABTkRsgJQSxZPgKZcqAfgRUAXAgAMKmvS3yyileLUaLzHgj2GTSqTNefpR48GAASzpaGAAzPABjdAAxKCgSABUxAG8fBDAEI2VVBETgAF8AhhBIgjwYdEioOiJEPCM4hIARPFoRAG5gErKKqpq6hAAjRviSVtoEAB8EOhwCAk6AgHpljEhS2gYTTjJIuHwCfWAUNAQAZQALKHmGACEQYwlMXEJSU5AoMJZOD6-hpZAA
Related Issues: Not that I know of
I filed this issue over here as well, millsp/ts-toolbelt#97
Looking at the type, it should work. But it doesn't. I think it might indicate something is broken with TS
The text was updated successfully, but these errors were encountered: