-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Domain: Conditional TypesThe issue relates to conditional typesThe issue relates to conditional typesEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
π Search Terms
any union
π Version & Regression Information
- This changed between versions 5.0.0-dev.20221207 and 5.0.0-dev.20221208
β― Playground Link
Playground link with relevant code
π» Code
type Spec = any extends object ? any : string;
type WithSpec<T extends number> = T
type R = WithSpec<Spec> // error here in 5.0
π Actual behavior
Spec
is any | string
so it can't be used with WithSpec
π Expected behavior
any | string
is reduced to any
as it was in 4.9
MartinJohns
Metadata
Metadata
Assignees
Labels
Domain: Conditional TypesThe issue relates to conditional typesThe issue relates to conditional typesEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this