Remove unnecessary check in getNarrowableTypeForReference

This commit is contained in:
Anders Hejlsberg
2022-02-18 06:54:04 -08:00
parent 53809d8ed1
commit aa1c25d35d
+1 -1
View File
@@ -25081,7 +25081,7 @@ namespace ts {
const substituteConstraints = !(checkMode && checkMode & CheckMode.Inferential) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
return substituteConstraints ? mapType(type, t => t.flags & TypeFlags.Instantiable && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t) : type;
return substituteConstraints ? mapType(type, t => t.flags & TypeFlags.Instantiable ? getBaseConstraintOrType(t) : t) : type;
}
function isExportOrExportExpression(location: Node) {