@@ -3635,6 +3635,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
3635
3635
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
3636
3636
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
3637
3637
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
3638
+ TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
3638
3639
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
3639
3640
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
3640
3641
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
@@ -3672,7 +3673,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
3672
3673
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
3673
3674
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
3674
3675
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
3675
- TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 268435456 /* StringMapping */] = "IncludesConstrainedTypeVariable";
3676
+ TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
3676
3677
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
3677
3678
return TypeFlags2;
3678
3679
})(TypeFlags || {});
@@ -57482,7 +57483,7 @@ function createTypeChecker(host) {
57482
57483
if (flags & 465829888 /* Instantiable */)
57483
57484
includes |= 33554432 /* IncludesInstantiable */;
57484
57485
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
57485
- includes |= 268435456 /* IncludesConstrainedTypeVariable */;
57486
+ includes |= 536870912 /* IncludesConstrainedTypeVariable */;
57486
57487
if (type === wildcardType)
57487
57488
includes |= 8388608 /* IncludesWildcard */;
57488
57489
if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -57575,18 +57576,21 @@ function createTypeChecker(host) {
57575
57576
}
57576
57577
}
57577
57578
function removeStringLiteralsMatchedByTemplateLiterals(types) {
57578
- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) );
57579
+ const templates = filter(types, isPatternLiteralType);
57579
57580
if (templates.length) {
57580
57581
let i = types.length;
57581
57582
while (i > 0) {
57582
57583
i--;
57583
57584
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))) {
57585
57586
orderedRemoveItemAt(types, i);
57586
57587
}
57587
57588
}
57588
57589
}
57589
57590
}
57591
+ function isTypeMatchedByTemplateLiteralOrStringMapping(type, template) {
57592
+ return template.flags & 134217728 /* TemplateLiteral */ ? isTypeMatchedByTemplateLiteralType(type, template) : isMemberOfStringMapping(type, template);
57593
+ }
57590
57594
function removeConstrainedTypeVariables(types) {
57591
57595
const typeVariables = [];
57592
57596
for (const type of types) {
@@ -57684,10 +57688,10 @@ function createTypeChecker(host) {
57684
57688
if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
57685
57689
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
57686
57690
}
57687
- if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
57691
+ if (includes & 128 /* StringLiteral */ && includes & ( 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ) {
57688
57692
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
57689
57693
}
57690
- if (includes & 268435456 /* IncludesConstrainedTypeVariable */) {
57694
+ if (includes & 536870912 /* IncludesConstrainedTypeVariable */) {
57691
57695
removeConstrainedTypeVariables(typeSet);
57692
57696
}
57693
57697
if (unionReduction === 2 /* Subtype */) {
@@ -57851,7 +57855,7 @@ function createTypeChecker(host) {
57851
57855
while (i > 0) {
57852
57856
i--;
57853
57857
const t = types[i];
57854
- if (!(t.flags & 134217728 /* TemplateLiteral */))
57858
+ if (!(t.flags & ( 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ))
57855
57859
continue;
57856
57860
for (const t2 of literals) {
57857
57861
if (isTypeSubtypeOf(t2, t)) {
@@ -57925,7 +57929,7 @@ function createTypeChecker(host) {
57925
57929
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 */)) {
57926
57930
return neverType;
57927
57931
}
57928
- if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
57932
+ if (includes & ( 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
57929
57933
return neverType;
57930
57934
}
57931
57935
if (includes & 1 /* Any */) {
0 commit comments