mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-17 00:34:47 -05:00
Fix comparability between type parameters related by a union constraint (#50978)
This commit is contained in:
@@ -19734,7 +19734,7 @@ namespace ts {
|
||||
// with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
|
||||
let constraint = getConstraintOfTypeParameter(source);
|
||||
if (constraint && hasNonCircularBaseConstraint(source)) {
|
||||
while (constraint && constraint.flags & TypeFlags.TypeParameter) {
|
||||
while (constraint && someType(constraint, c => !!(c.flags & TypeFlags.TypeParameter))) {
|
||||
if (result = isRelatedTo(constraint, target, RecursionFlags.Source, /*reportErrors*/ false)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user