From aa1c25d35d13228f38588854bbba9929dc83db84 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 18 Feb 2022 06:54:04 -0800 Subject: [PATCH] Remove unnecessary check in getNarrowableTypeForReference --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4a5a85db1398b..20f70b867980e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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) {