@@ -10383,11 +10383,11 @@ namespace ts {
10383
10383
// We attempt to resolve the conditional type only when the check and extends types are non-generic
10384
10384
if (!checkTypeInstantiable && !maybeTypeOfKind(inferredExtendsType, TypeFlags.Instantiable | TypeFlags.GenericMappedType)) {
10385
10385
if (inferredExtendsType.flags & TypeFlags.AnyOrUnknown) {
10386
- return instantiateType(root.trueType, combinedMapper || mapper) ;
10386
+ return combinedMapper ? instantiateType(root.trueType, combinedMapper) : trueType ;
10387
10387
}
10388
10388
// Return union of trueType and falseType for 'any' since it matches anything
10389
10389
if (checkType.flags & TypeFlags.Any) {
10390
- return getUnionType([instantiateType(root.trueType, combinedMapper || mapper) , falseType]);
10390
+ return getUnionType([combinedMapper ? instantiateType(root.trueType, combinedMapper) : trueType , falseType]);
10391
10391
}
10392
10392
// Return falseType for a definitely false extends check. We check an instantiations of the two
10393
10393
// types with type parameters mapped to the wildcard type, the most permissive instantiations
@@ -10402,7 +10402,7 @@ namespace ts {
10402
10402
// type Foo<T extends { x: any }> = T extends { x: string } ? string : number
10403
10403
// doesn't immediately resolve to 'string' instead of being deferred.
10404
10404
if (isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
10405
- return instantiateType(root.trueType, combinedMapper || mapper) ;
10405
+ return combinedMapper ? instantiateType(root.trueType, combinedMapper) : trueType ;
10406
10406
}
10407
10407
}
10408
10408
// Return a deferred type for a check that is neither definitely true nor definitely false
0 commit comments