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
On one hand, you want to allow comparison to/from constraints of type parameters because equality can always plausibly be true
On the other hand, you really don't want two type parameters to be
PR: Two types can be compared if their domains of possible values can overlap, but two type parameters cannot be compared unless one extends the other directly or indirectly.
Are there breaks?
Technically two explicitly constrained "unrelated" type parameters will no longer be related.
Numeric Keys
#48837
#27995
`${number}`number | `${number}`.keyofgets evaluated eagerly - we don't keep that information (i.e. whether the key types came from akeyofon an array) around.keyofgets orphaned somewhere else.Type Parameter Comparability
#48861
T extends unknownshouldn't be different fromTNarrowing Type Parameters and
unknown#48576
{}/objectbreaks code that does correct narrowing.T extends {} | null | undefined.TandT extends unknownwhen you have a contextual type that{}with type parameters some cases.