-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
Bug Report
π Search Terms
intersection never
π Version & Regression Information
- This changed between versions 4.9.0-dev.20220914 and 4.9.0-dev.20220915
β― Playground Link
Playground link with relevant code
π» Code
type AB = "A" | "B"
function x<T_AB extends AB>() {
let r2: never = null! as T_AB & undefined
} π Actual behavior
The assignment of r2 fails with Type 'T_AB & undefined' is not assignable to type 'never'.. Since T_AB does not contain undefined in its constraint, the intersection should reduce to never (as it did in 4.8)
π Expected behavior
The assignment should succeed.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.