@@ -3635,6 +3635,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
36353635 TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
36363636 TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
36373637 TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
3638+ TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
36383639 TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
36393640 TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
36403641 TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
@@ -3672,7 +3673,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
36723673 TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
36733674 TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
36743675 TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
3675- TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 268435456 /* StringMapping */] = "IncludesConstrainedTypeVariable";
3676+ TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
36763677 TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
36773678 return TypeFlags2;
36783679})(TypeFlags || {});
@@ -57482,7 +57483,7 @@ function createTypeChecker(host) {
5748257483 if (flags & 465829888 /* Instantiable */)
5748357484 includes |= 33554432 /* IncludesInstantiable */;
5748457485 if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
57485- includes |= 268435456 /* IncludesConstrainedTypeVariable */;
57486+ includes |= 536870912 /* IncludesConstrainedTypeVariable */;
5748657487 if (type === wildcardType)
5748757488 includes |= 8388608 /* IncludesWildcard */;
5748857489 if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -57575,18 +57576,21 @@ function createTypeChecker(host) {
5757557576 }
5757657577 }
5757757578 function removeStringLiteralsMatchedByTemplateLiterals(types) {
57578- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) );
57579+ const templates = filter(types, isPatternLiteralType);
5757957580 if (templates.length) {
5758057581 let i = types.length;
5758157582 while (i > 0) {
5758257583 i--;
5758357584 const t = types[i];
57584- if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralType (t, template))) {
57585+ if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping (t, template))) {
5758557586 orderedRemoveItemAt(types, i);
5758657587 }
5758757588 }
5758857589 }
5758957590 }
57591+ function isTypeMatchedByTemplateLiteralOrStringMapping(type, template) {
57592+ return template.flags & 134217728 /* TemplateLiteral */ ? isTypeMatchedByTemplateLiteralType(type, template) : isMemberOfStringMapping(type, template);
57593+ }
5759057594 function removeConstrainedTypeVariables(types) {
5759157595 const typeVariables = [];
5759257596 for (const type of types) {
@@ -57684,10 +57688,10 @@ function createTypeChecker(host) {
5768457688 if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
5768557689 removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
5768657690 }
57687- if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
57691+ if (includes & 128 /* StringLiteral */ && includes & ( 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ) {
5768857692 removeStringLiteralsMatchedByTemplateLiterals(typeSet);
5768957693 }
57690- if (includes & 268435456 /* IncludesConstrainedTypeVariable */) {
57694+ if (includes & 536870912 /* IncludesConstrainedTypeVariable */) {
5769157695 removeConstrainedTypeVariables(typeSet);
5769257696 }
5769357697 if (unionReduction === 2 /* Subtype */) {
@@ -57851,7 +57855,7 @@ function createTypeChecker(host) {
5785157855 while (i > 0) {
5785257856 i--;
5785357857 const t = types[i];
57854- if (!(t.flags & 134217728 /* TemplateLiteral */))
57858+ if (!(t.flags & ( 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ))
5785557859 continue;
5785657860 for (const t2 of literals) {
5785757861 if (isTypeSubtypeOf(t2, t)) {
@@ -57925,7 +57929,7 @@ function createTypeChecker(host) {
5792557929 if (strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) {
5792657930 return neverType;
5792757931 }
57928- if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
57932+ if (includes & ( 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
5792957933 return neverType;
5793057934 }
5793157935 if (includes & 1 /* Any */) {
0 commit comments