File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -10379,7 +10379,7 @@ namespace ts {
10379
10379
// Simplifications for types of the form `T extends U ? T : never` and `T extends U ? never : T`.
10380
10380
if (root.falseType.flags & TypeFlags.Never && getActualTypeVariable(root.trueType) === getActualTypeVariable(root.checkType)) {
10381
10381
if (checkType.flags & TypeFlags.Any || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { // Always true
10382
- return instantiateType(root.trueType, mapper) ;
10382
+ return checkType ;
10383
10383
}
10384
10384
else if (isIntersectionEmpty(checkType, extendsType)) { // Always false
10385
10385
return neverType;
@@ -10390,7 +10390,7 @@ namespace ts {
10390
10390
return neverType;
10391
10391
}
10392
10392
else if (checkType.flags & TypeFlags.Any || isIntersectionEmpty(checkType, extendsType)) { // Always false
10393
- return instantiateType(root.falseType, mapper) ;
10393
+ return checkType ;
10394
10394
}
10395
10395
}
10396
10396
const checkTypeInstantiable = maybeTypeOfKind(checkType, TypeFlags.Instantiable | TypeFlags.GenericMappedType);
You can’t perform that action at this time.
0 commit comments