-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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