From 8e76d1644e6742dc81ee5773bedbd86641bd1f36 Mon Sep 17 00:00:00 2001 From: "Pranav Senthilnathan (from Dev Box)" Date: Tue, 17 Oct 2023 13:28:45 -0700 Subject: [PATCH] naive perf change --- 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 9ed6f52c38c..f71c629fc95 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16939,7 +16939,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (includes & (TypeFlags.Enum | TypeFlags.Literal | TypeFlags.UniqueESSymbol | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) || includes & TypeFlags.Void && includes & TypeFlags.Undefined) { removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & UnionReduction.Subtype)); } - if (includes & TypeFlags.StringLiteral && includes & TypeFlags.TemplateLiteral) { + if (unionReduction === UnionReduction.Subtype && (includes & TypeFlags.StringLiteral && includes & TypeFlags.TemplateLiteral)) { removeStringLiteralsMatchedByTemplateLiterals(typeSet); } if (unionReduction === UnionReduction.Subtype) {