You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A conditional type immediately resolves to the true branch when the condition is satisfied with type parameters instantiated at the most restrictive type---a type parameter with unknown constraint.
A type parameter with unknown constraint is not the most restrictive type in all cases: any may be assigned to any type parameter, but any may not be assigned to never.
To be honest, this issue is incredibly niche, and almost exclusively a result of any (that I currently know of). The behaviour is also consistent with how things work in other cases, such as:
While the conditional behaviour is consistent with other cases where a type parameter can later be instantiated to never, I'm not sure anyone would ever want that behaviour in a conditional. Regardless of whether this is by design, a limitation, or a bug---I think it would be good to have this documented somewhere in the tracker.