File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -17418,9 +17418,10 @@ namespace ts {
17418
17418
// A substitution type originates in the true branch of a conditional type and can be resolved
17419
17419
// to just the base type in the same cases as the conditional type resolves to its true branch
17420
17420
// (because the base type is then known to satisfy the constraint).
17421
- if (newConstraint.flags & TypeFlags.AnyOrUnknown ||
17421
+ if (!(newBaseType.flags & TypeFlags.TypeVariable) && (
17422
+ newConstraint.flags & TypeFlags.AnyOrUnknown ||
17422
17423
!isGenericType(newBaseType) && !isGenericType(newConstraint) ||
17423
- isTypeAssignableTo(getRestrictiveInstantiation(newBaseType), getRestrictiveInstantiation(newConstraint))) {
17424
+ isTypeAssignableTo(getRestrictiveInstantiation(newBaseType), getRestrictiveInstantiation(newConstraint)))) {
17424
17425
return newBaseType;
17425
17426
}
17426
17427
return getSubstitutionType(newBaseType, newConstraint);
You can’t perform that action at this time.
0 commit comments