Intersection of type parameter and undefined is not never in 4.9 #51041
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
Bug Report
π Search Terms
intersection never
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The assignment of
r2
fails withType 'T_AB & undefined' is not assignable to type 'never'.
. SinceT_AB
does not containundefined
in its constraint, the intersection should reduce tonever
(as it did in 4.8)π Expected behavior
The assignment should succeed.
The text was updated successfully, but these errors were encountered: