-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Description
π Search Terms
generic, conditional, premature / eager / defer, inline,
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about generic conditional types
β― Playground Link
π» Code
type IsNumber<T> = [T] extends [number] ? true : false
type IsFalse<T extends boolean> = false[] extends T[] ? true : false
type Direct = IsFalse<IsNumber<string>> extends true ? 0 : 1;
// ^? type Direct = 0
type Shortcut<T> = IsFalse<IsNumber<T>> extends true ? 0 : 1;
type Indirect = Shortcut<string>;
// ^? type Indirect = 1
π Actual behavior
Direct
and Indirect
are different.
π Expected behavior
Direct
and Indirect
should be the same because Direct
is just an inlined version of Shortcut<string>
.
Additional information about the issue
This feels like a similar issue to #39364, #30708, #30020 and maybe some others, but many of those have been resolved already and yet this one remains. Came from this Stack Overflow question.
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.