@typescript-deploys/pr-build 5.1.0-pr-53300-9 → 5.1.0-pr-49863-27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.1";
26
- var version = `${versionMajorMinor}.0-insiders.20230316`;
26
+ var version = `${versionMajorMinor}.0-insiders.20230317`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -3721,7 +3721,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
3721
3721
  TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
3722
3722
  TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
3723
3723
  TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
3724
- TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323363] = "NotPrimitiveUnion";
3724
+ TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
3725
3725
  return TypeFlags2;
3726
3726
  })(TypeFlags || {});
3727
3727
  var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
@@ -42672,7 +42672,7 @@ function createTypeChecker(host) {
42672
42672
  var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
42673
42673
  var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
42674
42674
  var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
42675
- var strictInstanceOfTypeParameters = true;
42675
+ var strictInstanceOfTypeParameters = getStrictOptionValue(compilerOptions, "strictInstanceOfTypeParameters");
42676
42676
  var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
42677
42677
  var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
42678
42678
  var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
@@ -50655,8 +50655,8 @@ function createTypeChecker(host) {
50655
50655
  case 4 /* Independent */:
50656
50656
  case 3 /* Bivariant */:
50657
50657
  return anyType;
50658
- case 0 /* Invariant */:
50659
- return unknownType;
50658
+ case 2 /* Contravariant */:
50659
+ return neverType;
50660
50660
  }
50661
50661
  return getBaseConstraintOfType(typeParameter) || unknownType;
50662
50662
  });
@@ -56035,7 +56035,7 @@ function createTypeChecker(host) {
56035
56035
  origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
56036
56036
  }
56037
56037
  }
56038
- const objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
56038
+ const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
56039
56039
  return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
56040
56040
  }
56041
56041
  function getUnionOrIntersectionTypePredicate(signatures, kind) {
@@ -56160,7 +56160,7 @@ function createTypeChecker(host) {
56160
56160
  function eachUnionContains(unionTypes2, type) {
56161
56161
  for (const u of unionTypes2) {
56162
56162
  if (!containsType(u.types, type)) {
56163
- const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
56163
+ const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & (32 /* Enum */ | 256 /* NumberLiteral */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
56164
56164
  if (!primitive || !containsType(u.types, primitive)) {
56165
56165
  return false;
56166
56166
  }
@@ -56187,9 +56187,6 @@ function createTypeChecker(host) {
56187
56187
  }
56188
56188
  return false;
56189
56189
  }
56190
- function eachIsUnionContaining(types, flag) {
56191
- return every(types, (t) => !!(t.flags & 1048576 /* Union */) && some(t.types, (tt) => !!(tt.flags & flag)));
56192
- }
56193
56190
  function removeFromEach(types, flag) {
56194
56191
  for (let i = 0; i < types.length; i++) {
56195
56192
  types[i] = filterType(types[i], (t) => !(t.flags & flag));
@@ -56278,11 +56275,11 @@ function createTypeChecker(host) {
56278
56275
  if (includes & 1048576 /* Union */) {
56279
56276
  if (intersectUnionsOfPrimitiveTypes(typeSet)) {
56280
56277
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
56281
- } else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
56278
+ } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
56282
56279
  const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
56283
56280
  removeFromEach(typeSet, 32768 /* Undefined */);
56284
56281
  result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
56285
- } else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
56282
+ } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
56286
56283
  removeFromEach(typeSet, 65536 /* Null */);
56287
56284
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
56288
56285
  } else {
@@ -59807,6 +59804,11 @@ function createTypeChecker(host) {
59807
59804
  if (containsType(targetTypes, source2)) {
59808
59805
  return -1 /* True */;
59809
59806
  }
59807
+ if (getObjectFlags(target2) & 32768 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
59808
+ const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
59809
+ const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
59810
+ return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
59811
+ }
59810
59812
  const match = getMatchingUnionConstituentForType(target2, source2);
59811
59813
  if (match) {
59812
59814
  const related = isRelatedTo(
package/lib/tsserver.js CHANGED
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(server_exports);
2285
2285
 
2286
2286
  // src/compiler/corePublic.ts
2287
2287
  var versionMajorMinor = "5.1";
2288
- var version = `${versionMajorMinor}.0-insiders.20230316`;
2288
+ var version = `${versionMajorMinor}.0-insiders.20230317`;
2289
2289
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2290
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2291
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6642,7 +6642,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
6642
6642
  TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
6643
6643
  TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
6644
6644
  TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
6645
- TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323363] = "NotPrimitiveUnion";
6645
+ TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
6646
6646
  return TypeFlags2;
6647
6647
  })(TypeFlags || {});
6648
6648
  var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
@@ -47269,7 +47269,7 @@ function createTypeChecker(host) {
47269
47269
  var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
47270
47270
  var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
47271
47271
  var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
47272
- var strictInstanceOfTypeParameters = true;
47272
+ var strictInstanceOfTypeParameters = getStrictOptionValue(compilerOptions, "strictInstanceOfTypeParameters");
47273
47273
  var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
47274
47274
  var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
47275
47275
  var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
@@ -55252,8 +55252,8 @@ function createTypeChecker(host) {
55252
55252
  case 4 /* Independent */:
55253
55253
  case 3 /* Bivariant */:
55254
55254
  return anyType;
55255
- case 0 /* Invariant */:
55256
- return unknownType;
55255
+ case 2 /* Contravariant */:
55256
+ return neverType;
55257
55257
  }
55258
55258
  return getBaseConstraintOfType(typeParameter) || unknownType;
55259
55259
  });
@@ -60632,7 +60632,7 @@ function createTypeChecker(host) {
60632
60632
  origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
60633
60633
  }
60634
60634
  }
60635
- const objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
60635
+ const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
60636
60636
  return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
60637
60637
  }
60638
60638
  function getUnionOrIntersectionTypePredicate(signatures, kind) {
@@ -60757,7 +60757,7 @@ function createTypeChecker(host) {
60757
60757
  function eachUnionContains(unionTypes2, type) {
60758
60758
  for (const u of unionTypes2) {
60759
60759
  if (!containsType(u.types, type)) {
60760
- const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
60760
+ const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & (32 /* Enum */ | 256 /* NumberLiteral */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
60761
60761
  if (!primitive || !containsType(u.types, primitive)) {
60762
60762
  return false;
60763
60763
  }
@@ -60784,9 +60784,6 @@ function createTypeChecker(host) {
60784
60784
  }
60785
60785
  return false;
60786
60786
  }
60787
- function eachIsUnionContaining(types, flag) {
60788
- return every(types, (t) => !!(t.flags & 1048576 /* Union */) && some(t.types, (tt) => !!(tt.flags & flag)));
60789
- }
60790
60787
  function removeFromEach(types, flag) {
60791
60788
  for (let i = 0; i < types.length; i++) {
60792
60789
  types[i] = filterType(types[i], (t) => !(t.flags & flag));
@@ -60875,11 +60872,11 @@ function createTypeChecker(host) {
60875
60872
  if (includes & 1048576 /* Union */) {
60876
60873
  if (intersectUnionsOfPrimitiveTypes(typeSet)) {
60877
60874
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
60878
- } else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
60875
+ } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
60879
60876
  const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
60880
60877
  removeFromEach(typeSet, 32768 /* Undefined */);
60881
60878
  result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
60882
- } else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
60879
+ } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
60883
60880
  removeFromEach(typeSet, 65536 /* Null */);
60884
60881
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
60885
60882
  } else {
@@ -64404,6 +64401,11 @@ function createTypeChecker(host) {
64404
64401
  if (containsType(targetTypes, source2)) {
64405
64402
  return -1 /* True */;
64406
64403
  }
64404
+ if (getObjectFlags(target2) & 32768 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
64405
+ const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
64406
+ const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
64407
+ return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
64408
+ }
64407
64409
  const match = getMatchingUnionConstituentForType(target2, source2);
64408
64410
  if (match) {
64409
64411
  const related = isRelatedTo(
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-insiders.20230316`;
38
+ version = `${versionMajorMinor}.0-insiders.20230317`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -4449,7 +4449,7 @@ ${lanes.join("\n")}
4449
4449
  TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
4450
4450
  TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
4451
4451
  TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
4452
- TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323363] = "NotPrimitiveUnion";
4452
+ TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
4453
4453
  return TypeFlags2;
4454
4454
  })(TypeFlags || {});
4455
4455
  ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
@@ -45079,7 +45079,7 @@ ${lanes.join("\n")}
45079
45079
  var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
45080
45080
  var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
45081
45081
  var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
45082
- var strictInstanceOfTypeParameters = true;
45082
+ var strictInstanceOfTypeParameters = getStrictOptionValue(compilerOptions, "strictInstanceOfTypeParameters");
45083
45083
  var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
45084
45084
  var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
45085
45085
  var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
@@ -53062,8 +53062,8 @@ ${lanes.join("\n")}
53062
53062
  case 4 /* Independent */:
53063
53063
  case 3 /* Bivariant */:
53064
53064
  return anyType;
53065
- case 0 /* Invariant */:
53066
- return unknownType;
53065
+ case 2 /* Contravariant */:
53066
+ return neverType;
53067
53067
  }
53068
53068
  return getBaseConstraintOfType(typeParameter) || unknownType;
53069
53069
  });
@@ -58442,7 +58442,7 @@ ${lanes.join("\n")}
58442
58442
  origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
58443
58443
  }
58444
58444
  }
58445
- const objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
58445
+ const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
58446
58446
  return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
58447
58447
  }
58448
58448
  function getUnionOrIntersectionTypePredicate(signatures, kind) {
@@ -58567,7 +58567,7 @@ ${lanes.join("\n")}
58567
58567
  function eachUnionContains(unionTypes2, type) {
58568
58568
  for (const u of unionTypes2) {
58569
58569
  if (!containsType(u.types, type)) {
58570
- const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
58570
+ const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & (32 /* Enum */ | 256 /* NumberLiteral */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
58571
58571
  if (!primitive || !containsType(u.types, primitive)) {
58572
58572
  return false;
58573
58573
  }
@@ -58594,9 +58594,6 @@ ${lanes.join("\n")}
58594
58594
  }
58595
58595
  return false;
58596
58596
  }
58597
- function eachIsUnionContaining(types, flag) {
58598
- return every(types, (t) => !!(t.flags & 1048576 /* Union */) && some(t.types, (tt) => !!(tt.flags & flag)));
58599
- }
58600
58597
  function removeFromEach(types, flag) {
58601
58598
  for (let i = 0; i < types.length; i++) {
58602
58599
  types[i] = filterType(types[i], (t) => !(t.flags & flag));
@@ -58685,11 +58682,11 @@ ${lanes.join("\n")}
58685
58682
  if (includes & 1048576 /* Union */) {
58686
58683
  if (intersectUnionsOfPrimitiveTypes(typeSet)) {
58687
58684
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
58688
- } else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
58685
+ } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
58689
58686
  const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
58690
58687
  removeFromEach(typeSet, 32768 /* Undefined */);
58691
58688
  result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
58692
- } else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
58689
+ } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
58693
58690
  removeFromEach(typeSet, 65536 /* Null */);
58694
58691
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
58695
58692
  } else {
@@ -62214,6 +62211,11 @@ ${lanes.join("\n")}
62214
62211
  if (containsType(targetTypes, source2)) {
62215
62212
  return -1 /* True */;
62216
62213
  }
62214
+ if (getObjectFlags(target2) & 32768 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
62215
+ const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
62216
+ const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
62217
+ return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
62218
+ }
62217
62219
  const match = getMatchingUnionConstituentForType(target2, source2);
62218
62220
  if (match) {
62219
62221
  const related = isRelatedTo(
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-insiders.20230316`;
38
+ version = `${versionMajorMinor}.0-insiders.20230317`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -4449,7 +4449,7 @@ ${lanes.join("\n")}
4449
4449
  TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
4450
4450
  TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
4451
4451
  TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
4452
- TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323363] = "NotPrimitiveUnion";
4452
+ TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
4453
4453
  return TypeFlags2;
4454
4454
  })(TypeFlags || {});
4455
4455
  ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
@@ -45079,7 +45079,7 @@ ${lanes.join("\n")}
45079
45079
  var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
45080
45080
  var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
45081
45081
  var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
45082
- var strictInstanceOfTypeParameters = true;
45082
+ var strictInstanceOfTypeParameters = getStrictOptionValue(compilerOptions, "strictInstanceOfTypeParameters");
45083
45083
  var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
45084
45084
  var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
45085
45085
  var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
@@ -53062,8 +53062,8 @@ ${lanes.join("\n")}
53062
53062
  case 4 /* Independent */:
53063
53063
  case 3 /* Bivariant */:
53064
53064
  return anyType;
53065
- case 0 /* Invariant */:
53066
- return unknownType;
53065
+ case 2 /* Contravariant */:
53066
+ return neverType;
53067
53067
  }
53068
53068
  return getBaseConstraintOfType(typeParameter) || unknownType;
53069
53069
  });
@@ -58442,7 +58442,7 @@ ${lanes.join("\n")}
58442
58442
  origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
58443
58443
  }
58444
58444
  }
58445
- const objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
58445
+ const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
58446
58446
  return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
58447
58447
  }
58448
58448
  function getUnionOrIntersectionTypePredicate(signatures, kind) {
@@ -58567,7 +58567,7 @@ ${lanes.join("\n")}
58567
58567
  function eachUnionContains(unionTypes2, type) {
58568
58568
  for (const u of unionTypes2) {
58569
58569
  if (!containsType(u.types, type)) {
58570
- const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
58570
+ const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & (32 /* Enum */ | 256 /* NumberLiteral */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
58571
58571
  if (!primitive || !containsType(u.types, primitive)) {
58572
58572
  return false;
58573
58573
  }
@@ -58594,9 +58594,6 @@ ${lanes.join("\n")}
58594
58594
  }
58595
58595
  return false;
58596
58596
  }
58597
- function eachIsUnionContaining(types, flag) {
58598
- return every(types, (t) => !!(t.flags & 1048576 /* Union */) && some(t.types, (tt) => !!(tt.flags & flag)));
58599
- }
58600
58597
  function removeFromEach(types, flag) {
58601
58598
  for (let i = 0; i < types.length; i++) {
58602
58599
  types[i] = filterType(types[i], (t) => !(t.flags & flag));
@@ -58685,11 +58682,11 @@ ${lanes.join("\n")}
58685
58682
  if (includes & 1048576 /* Union */) {
58686
58683
  if (intersectUnionsOfPrimitiveTypes(typeSet)) {
58687
58684
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
58688
- } else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
58685
+ } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
58689
58686
  const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
58690
58687
  removeFromEach(typeSet, 32768 /* Undefined */);
58691
58688
  result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
58692
- } else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
58689
+ } else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
58693
58690
  removeFromEach(typeSet, 65536 /* Null */);
58694
58691
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
58695
58692
  } else {
@@ -62214,6 +62211,11 @@ ${lanes.join("\n")}
62214
62211
  if (containsType(targetTypes, source2)) {
62215
62212
  return -1 /* True */;
62216
62213
  }
62214
+ if (getObjectFlags(target2) & 32768 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
62215
+ const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
62216
+ const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
62217
+ return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
62218
+ }
62217
62219
  const match = getMatchingUnionConstituentForType(target2, source2);
62218
62220
  if (match) {
62219
62221
  const related = isRelatedTo(
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.1";
57
- var version = `${versionMajorMinor}.0-insiders.20230316`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230317`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -3127,7 +3127,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
3127
3127
  TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
3128
3128
  TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
3129
3129
  TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
3130
- TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323363] = "NotPrimitiveUnion";
3130
+ TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
3131
3131
  return TypeFlags2;
3132
3132
  })(TypeFlags || {});
3133
3133
  var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.1.0-pr-53300-9",
5
+ "version": "5.1.0-pr-49863-27",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -79,7 +79,7 @@
79
79
  "node-fetch": "^3.2.10",
80
80
  "source-map-support": "^0.5.21",
81
81
  "tslib": "^2.5.0",
82
- "typescript": "5.0.1-rc",
82
+ "typescript": "^5.0.2",
83
83
  "which": "^2.0.2"
84
84
  },
85
85
  "overrides": {
@@ -114,5 +114,5 @@
114
114
  "node": "14.21.1",
115
115
  "npm": "8.19.3"
116
116
  },
117
- "gitHead": "9d11a451a9b7cee2223e23f50f997867a03547ec"
117
+ "gitHead": "a6ea599f1c25108b1745bc28aef501251ff356b9"
118
118
  }