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}`
.keyof
gets evaluated eagerly - we don't keep that information (i.e. whether the key types came from akeyof
on an array) around.keyof
gets orphaned somewhere else.Type Parameter Comparability
#48861
T extends unknown
shouldn't be different fromT
Narrowing Type Parameters and
unknown
#48576
{}
/object
breaks code that does correct narrowing.T extends {} | null | undefined
.T
andT extends unknown
when you have a contextual type that{}
with type parameters some cases.The text was updated successfully, but these errors were encountered: