Skip to content

Commit e806758

Browse files
Update LKG
1 parent d3f2a17 commit e806758

File tree

5 files changed

+39
-26
lines changed

5 files changed

+39
-26
lines changed

Diff for: lib/tsc.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -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 */) {

Diff for: lib/tsserver.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -6659,6 +6659,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
66596659
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
66606660
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
66616661
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
6662+
TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
66626663
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
66636664
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
66646665
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
@@ -6696,7 +6697,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
66966697
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
66976698
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
66986699
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
6699-
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 268435456 /* StringMapping */] = "IncludesConstrainedTypeVariable";
6700+
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
67006701
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
67016702
return TypeFlags2;
67026703
})(TypeFlags || {});
@@ -62217,7 +62218,7 @@ function createTypeChecker(host) {
6221762218
if (flags & 465829888 /* Instantiable */)
6221862219
includes |= 33554432 /* IncludesInstantiable */;
6221962220
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
62220-
includes |= 268435456 /* IncludesConstrainedTypeVariable */;
62221+
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
6222162222
if (type === wildcardType)
6222262223
includes |= 8388608 /* IncludesWildcard */;
6222362224
if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -62310,18 +62311,21 @@ function createTypeChecker(host) {
6231062311
}
6231162312
}
6231262313
function removeStringLiteralsMatchedByTemplateLiterals(types) {
62313-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
62314+
const templates = filter(types, isPatternLiteralType);
6231462315
if (templates.length) {
6231562316
let i = types.length;
6231662317
while (i > 0) {
6231762318
i--;
6231862319
const t = types[i];
62319-
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralType(t, template))) {
62320+
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
6232062321
orderedRemoveItemAt(types, i);
6232162322
}
6232262323
}
6232362324
}
6232462325
}
62326+
function isTypeMatchedByTemplateLiteralOrStringMapping(type, template) {
62327+
return template.flags & 134217728 /* TemplateLiteral */ ? isTypeMatchedByTemplateLiteralType(type, template) : isMemberOfStringMapping(type, template);
62328+
}
6232562329
function removeConstrainedTypeVariables(types) {
6232662330
const typeVariables = [];
6232762331
for (const type of types) {
@@ -62419,10 +62423,10 @@ function createTypeChecker(host) {
6241962423
if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
6242062424
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
6242162425
}
62422-
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
62426+
if (includes & 128 /* StringLiteral */ && includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) {
6242362427
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
6242462428
}
62425-
if (includes & 268435456 /* IncludesConstrainedTypeVariable */) {
62429+
if (includes & 536870912 /* IncludesConstrainedTypeVariable */) {
6242662430
removeConstrainedTypeVariables(typeSet);
6242762431
}
6242862432
if (unionReduction === 2 /* Subtype */) {
@@ -62586,7 +62590,7 @@ function createTypeChecker(host) {
6258662590
while (i > 0) {
6258762591
i--;
6258862592
const t = types[i];
62589-
if (!(t.flags & 134217728 /* TemplateLiteral */))
62593+
if (!(t.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)))
6259062594
continue;
6259162595
for (const t2 of literals) {
6259262596
if (isTypeSubtypeOf(t2, t)) {
@@ -62660,7 +62664,7 @@ function createTypeChecker(host) {
6266062664
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 */)) {
6266162665
return neverType;
6266262666
}
62663-
if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
62667+
if (includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
6266462668
return neverType;
6266562669
}
6266662670
if (includes & 1 /* Any */) {

Diff for: lib/typescript.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ declare namespace ts {
205205
/**
206206
* Request to reload the project structure for all the opened files
207207
*/
208-
interface ReloadProjectsRequest extends Message {
208+
interface ReloadProjectsRequest extends Request {
209209
command: CommandTypes.ReloadProjects;
210210
}
211211
/**

Diff for: lib/typescript.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -4412,6 +4412,7 @@ ${lanes.join("\n")}
44124412
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
44134413
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
44144414
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
4415+
TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
44154416
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
44164417
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
44174418
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
@@ -4449,7 +4450,7 @@ ${lanes.join("\n")}
44494450
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
44504451
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
44514452
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
4452-
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 268435456 /* StringMapping */] = "IncludesConstrainedTypeVariable";
4453+
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
44534454
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
44544455
return TypeFlags2;
44554456
})(TypeFlags || {});
@@ -59971,7 +59972,7 @@ ${lanes.join("\n")}
5997159972
if (flags & 465829888 /* Instantiable */)
5997259973
includes |= 33554432 /* IncludesInstantiable */;
5997359974
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
59974-
includes |= 268435456 /* IncludesConstrainedTypeVariable */;
59975+
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
5997559976
if (type === wildcardType)
5997659977
includes |= 8388608 /* IncludesWildcard */;
5997759978
if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -60064,18 +60065,21 @@ ${lanes.join("\n")}
6006460065
}
6006560066
}
6006660067
function removeStringLiteralsMatchedByTemplateLiterals(types) {
60067-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
60068+
const templates = filter(types, isPatternLiteralType);
6006860069
if (templates.length) {
6006960070
let i = types.length;
6007060071
while (i > 0) {
6007160072
i--;
6007260073
const t = types[i];
60073-
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralType(t, template))) {
60074+
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
6007460075
orderedRemoveItemAt(types, i);
6007560076
}
6007660077
}
6007760078
}
6007860079
}
60080+
function isTypeMatchedByTemplateLiteralOrStringMapping(type, template) {
60081+
return template.flags & 134217728 /* TemplateLiteral */ ? isTypeMatchedByTemplateLiteralType(type, template) : isMemberOfStringMapping(type, template);
60082+
}
6007960083
function removeConstrainedTypeVariables(types) {
6008060084
const typeVariables = [];
6008160085
for (const type of types) {
@@ -60173,10 +60177,10 @@ ${lanes.join("\n")}
6017360177
if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
6017460178
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
6017560179
}
60176-
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
60180+
if (includes & 128 /* StringLiteral */ && includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) {
6017760181
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
6017860182
}
60179-
if (includes & 268435456 /* IncludesConstrainedTypeVariable */) {
60183+
if (includes & 536870912 /* IncludesConstrainedTypeVariable */) {
6018060184
removeConstrainedTypeVariables(typeSet);
6018160185
}
6018260186
if (unionReduction === 2 /* Subtype */) {
@@ -60340,7 +60344,7 @@ ${lanes.join("\n")}
6034060344
while (i > 0) {
6034160345
i--;
6034260346
const t = types[i];
60343-
if (!(t.flags & 134217728 /* TemplateLiteral */))
60347+
if (!(t.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)))
6034460348
continue;
6034560349
for (const t2 of literals) {
6034660350
if (isTypeSubtypeOf(t2, t)) {
@@ -60414,7 +60418,7 @@ ${lanes.join("\n")}
6041460418
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 */)) {
6041560419
return neverType;
6041660420
}
60417-
if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
60421+
if (includes & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {
6041860422
return neverType;
6041960423
}
6042060424
if (includes & 1 /* Any */) {

Diff for: lib/typingsInstaller.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3069,6 +3069,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
30693069
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
30703070
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
30713071
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
3072+
TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
30723073
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
30733074
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
30743075
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
@@ -3106,7 +3107,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
31063107
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
31073108
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
31083109
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
3109-
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 268435456 /* StringMapping */] = "IncludesConstrainedTypeVariable";
3110+
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
31103111
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
31113112
return TypeFlags2;
31123113
})(TypeFlags || {});

0 commit comments

Comments
 (0)