@typescript-deploys/pr-build 5.3.0-pr-56105-6 → 5.3.0-pr-56004-36

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
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.3";
21
- var version = `${versionMajorMinor}.0-insiders.20231013`;
21
+ var version = `${versionMajorMinor}.0-insiders.20231015`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -54085,7 +54085,12 @@ function createTypeChecker(host) {
54085
54085
  const checkType = type.checkType;
54086
54086
  const constraint = getLowerBoundOfKeyType(checkType);
54087
54087
  if (constraint !== checkType) {
54088
- return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
54088
+ return getConditionalTypeInstantiation(
54089
+ type,
54090
+ prependTypeMapping(type.root.checkType, constraint, type.mapper),
54091
+ /*forConstraint*/
54092
+ false
54093
+ );
54089
54094
  }
54090
54095
  }
54091
54096
  return type;
@@ -54437,7 +54442,12 @@ function createTypeChecker(host) {
54437
54442
  );
54438
54443
  const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;
54439
54444
  if (constraint && constraint !== type.checkType) {
54440
- const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
54445
+ const instantiated = getConditionalTypeInstantiation(
54446
+ type,
54447
+ prependTypeMapping(type.root.checkType, constraint, type.mapper),
54448
+ /*forConstraint*/
54449
+ true
54450
+ );
54441
54451
  if (!(instantiated.flags & 131072 /* Never */)) {
54442
54452
  type.resolvedConstraintOfDistributive = instantiated;
54443
54453
  return instantiated;
@@ -58000,7 +58010,7 @@ function createTypeChecker(host) {
58000
58010
  function isDeferredType(type, checkTuples) {
58001
58011
  return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
58002
58012
  }
58003
- function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
58013
+ function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
58004
58014
  let result;
58005
58015
  let extraTypes;
58006
58016
  let tailCount = 0;
@@ -58046,7 +58056,7 @@ function createTypeChecker(host) {
58046
58056
  const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
58047
58057
  if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
58048
58058
  if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
58049
- if (checkType.flags & 1 /* Any */) {
58059
+ if (checkType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
58050
58060
  (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
58051
58061
  }
58052
58062
  const falseType2 = getTypeFromTypeNode(root.node.falseType);
@@ -58156,7 +58166,9 @@ function createTypeChecker(host) {
58156
58166
  links.resolvedType = getConditionalType(
58157
58167
  root,
58158
58168
  /*mapper*/
58159
- void 0
58169
+ void 0,
58170
+ /*forConstraint*/
58171
+ false
58160
58172
  );
58161
58173
  if (outerTypeParameters) {
58162
58174
  root.instantiations = /* @__PURE__ */ new Map();
@@ -59010,17 +59022,17 @@ function createTypeChecker(host) {
59010
59022
  result.objectFlags |= result.aliasTypeArguments ? getPropagatingFlagsOfTypes(result.aliasTypeArguments) : 0;
59011
59023
  return result;
59012
59024
  }
59013
- function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
59025
+ function getConditionalTypeInstantiation(type, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
59014
59026
  const root = type.root;
59015
59027
  if (root.outerTypeParameters) {
59016
59028
  const typeArguments = map(root.outerTypeParameters, (t) => getMappedType(t, mapper));
59017
- const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
59029
+ const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
59018
59030
  let result = root.instantiations.get(id);
59019
59031
  if (!result) {
59020
59032
  const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
59021
59033
  const checkType = root.checkType;
59022
59034
  const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
59023
- result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper)), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);
59035
+ result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
59024
59036
  root.instantiations.set(id, result);
59025
59037
  }
59026
59038
  return result;
@@ -59108,7 +59120,14 @@ function createTypeChecker(host) {
59108
59120
  );
59109
59121
  }
59110
59122
  if (flags & 16777216 /* Conditional */) {
59111
- return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper), aliasSymbol, aliasTypeArguments);
59123
+ return getConditionalTypeInstantiation(
59124
+ type,
59125
+ combineTypeMappers(type.mapper, mapper),
59126
+ /*forConstraint*/
59127
+ false,
59128
+ aliasSymbol,
59129
+ aliasTypeArguments
59130
+ );
59112
59131
  }
59113
59132
  if (flags & 33554432 /* Substitution */) {
59114
59133
  const newBaseType = instantiateType(type.baseType, mapper);
@@ -61649,13 +61668,6 @@ function createTypeChecker(host) {
61649
61668
  return result2;
61650
61669
  }
61651
61670
  }
61652
- } else {
61653
- const distributiveConstraint = hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
61654
- if (distributiveConstraint) {
61655
- if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
61656
- return result2;
61657
- }
61658
- }
61659
61671
  }
61660
61672
  const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
61661
61673
  if (defaultConstraint) {
@@ -61663,6 +61675,13 @@ function createTypeChecker(host) {
61663
61675
  return result2;
61664
61676
  }
61665
61677
  }
61678
+ const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
61679
+ if (distributiveConstraint) {
61680
+ resetErrorInfo(saveErrorInfo);
61681
+ if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
61682
+ return result2;
61683
+ }
61684
+ }
61666
61685
  } else {
61667
61686
  if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) {
61668
61687
  return -1 /* True */;
@@ -69464,21 +69483,8 @@ function createTypeChecker(host) {
69464
69483
  function getEnclosingClassFromThisParameter(node) {
69465
69484
  const thisParameter = getThisParameterFromNodeContext(node);
69466
69485
  let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
69467
- if (thisType) {
69468
- if (thisType.flags & 262144 /* TypeParameter */) {
69469
- thisType = getConstraintOfTypeParameter(thisType);
69470
- }
69471
- } else {
69472
- const thisContainer = getThisContainer(
69473
- node,
69474
- /*includeArrowFunctions*/
69475
- false,
69476
- /*includeClassComputedPropertyName*/
69477
- false
69478
- );
69479
- if (isFunctionLike(thisContainer)) {
69480
- thisType = getContextualThisParameterType(thisContainer);
69481
- }
69486
+ if (thisType && thisType.flags & 262144 /* TypeParameter */) {
69487
+ thisType = getConstraintOfTypeParameter(thisType);
69482
69488
  }
69483
69489
  if (thisType && getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
69484
69490
  return getTargetType(thisType);
package/lib/tsserver.js CHANGED
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
2328
2328
 
2329
2329
  // src/compiler/corePublic.ts
2330
2330
  var versionMajorMinor = "5.3";
2331
- var version = `${versionMajorMinor}.0-insiders.20231013`;
2331
+ var version = `${versionMajorMinor}.0-insiders.20231015`;
2332
2332
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2333
2333
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2334
2334
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -58797,7 +58797,12 @@ function createTypeChecker(host) {
58797
58797
  const checkType = type.checkType;
58798
58798
  const constraint = getLowerBoundOfKeyType(checkType);
58799
58799
  if (constraint !== checkType) {
58800
- return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
58800
+ return getConditionalTypeInstantiation(
58801
+ type,
58802
+ prependTypeMapping(type.root.checkType, constraint, type.mapper),
58803
+ /*forConstraint*/
58804
+ false
58805
+ );
58801
58806
  }
58802
58807
  }
58803
58808
  return type;
@@ -59149,7 +59154,12 @@ function createTypeChecker(host) {
59149
59154
  );
59150
59155
  const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;
59151
59156
  if (constraint && constraint !== type.checkType) {
59152
- const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
59157
+ const instantiated = getConditionalTypeInstantiation(
59158
+ type,
59159
+ prependTypeMapping(type.root.checkType, constraint, type.mapper),
59160
+ /*forConstraint*/
59161
+ true
59162
+ );
59153
59163
  if (!(instantiated.flags & 131072 /* Never */)) {
59154
59164
  type.resolvedConstraintOfDistributive = instantiated;
59155
59165
  return instantiated;
@@ -62712,7 +62722,7 @@ function createTypeChecker(host) {
62712
62722
  function isDeferredType(type, checkTuples) {
62713
62723
  return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
62714
62724
  }
62715
- function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
62725
+ function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
62716
62726
  let result;
62717
62727
  let extraTypes;
62718
62728
  let tailCount = 0;
@@ -62758,7 +62768,7 @@ function createTypeChecker(host) {
62758
62768
  const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
62759
62769
  if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
62760
62770
  if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
62761
- if (checkType.flags & 1 /* Any */) {
62771
+ if (checkType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
62762
62772
  (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
62763
62773
  }
62764
62774
  const falseType2 = getTypeFromTypeNode(root.node.falseType);
@@ -62868,7 +62878,9 @@ function createTypeChecker(host) {
62868
62878
  links.resolvedType = getConditionalType(
62869
62879
  root,
62870
62880
  /*mapper*/
62871
- void 0
62881
+ void 0,
62882
+ /*forConstraint*/
62883
+ false
62872
62884
  );
62873
62885
  if (outerTypeParameters) {
62874
62886
  root.instantiations = /* @__PURE__ */ new Map();
@@ -63722,17 +63734,17 @@ function createTypeChecker(host) {
63722
63734
  result.objectFlags |= result.aliasTypeArguments ? getPropagatingFlagsOfTypes(result.aliasTypeArguments) : 0;
63723
63735
  return result;
63724
63736
  }
63725
- function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
63737
+ function getConditionalTypeInstantiation(type, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
63726
63738
  const root = type.root;
63727
63739
  if (root.outerTypeParameters) {
63728
63740
  const typeArguments = map(root.outerTypeParameters, (t) => getMappedType(t, mapper));
63729
- const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
63741
+ const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
63730
63742
  let result = root.instantiations.get(id);
63731
63743
  if (!result) {
63732
63744
  const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
63733
63745
  const checkType = root.checkType;
63734
63746
  const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
63735
- result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper)), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);
63747
+ result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
63736
63748
  root.instantiations.set(id, result);
63737
63749
  }
63738
63750
  return result;
@@ -63820,7 +63832,14 @@ function createTypeChecker(host) {
63820
63832
  );
63821
63833
  }
63822
63834
  if (flags & 16777216 /* Conditional */) {
63823
- return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper), aliasSymbol, aliasTypeArguments);
63835
+ return getConditionalTypeInstantiation(
63836
+ type,
63837
+ combineTypeMappers(type.mapper, mapper),
63838
+ /*forConstraint*/
63839
+ false,
63840
+ aliasSymbol,
63841
+ aliasTypeArguments
63842
+ );
63824
63843
  }
63825
63844
  if (flags & 33554432 /* Substitution */) {
63826
63845
  const newBaseType = instantiateType(type.baseType, mapper);
@@ -66361,13 +66380,6 @@ function createTypeChecker(host) {
66361
66380
  return result2;
66362
66381
  }
66363
66382
  }
66364
- } else {
66365
- const distributiveConstraint = hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
66366
- if (distributiveConstraint) {
66367
- if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
66368
- return result2;
66369
- }
66370
- }
66371
66383
  }
66372
66384
  const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
66373
66385
  if (defaultConstraint) {
@@ -66375,6 +66387,13 @@ function createTypeChecker(host) {
66375
66387
  return result2;
66376
66388
  }
66377
66389
  }
66390
+ const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
66391
+ if (distributiveConstraint) {
66392
+ resetErrorInfo(saveErrorInfo);
66393
+ if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
66394
+ return result2;
66395
+ }
66396
+ }
66378
66397
  } else {
66379
66398
  if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) {
66380
66399
  return -1 /* True */;
@@ -74176,21 +74195,8 @@ function createTypeChecker(host) {
74176
74195
  function getEnclosingClassFromThisParameter(node) {
74177
74196
  const thisParameter = getThisParameterFromNodeContext(node);
74178
74197
  let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
74179
- if (thisType) {
74180
- if (thisType.flags & 262144 /* TypeParameter */) {
74181
- thisType = getConstraintOfTypeParameter(thisType);
74182
- }
74183
- } else {
74184
- const thisContainer = getThisContainer(
74185
- node,
74186
- /*includeArrowFunctions*/
74187
- false,
74188
- /*includeClassComputedPropertyName*/
74189
- false
74190
- );
74191
- if (isFunctionLike(thisContainer)) {
74192
- thisType = getContextualThisParameterType(thisContainer);
74193
- }
74198
+ if (thisType && thisType.flags & 262144 /* TypeParameter */) {
74199
+ thisType = getConstraintOfTypeParameter(thisType);
74194
74200
  }
74195
74201
  if (thisType && getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
74196
74202
  return getTargetType(thisType);
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.3";
38
- version = `${versionMajorMinor}.0-insiders.20231013`;
38
+ version = `${versionMajorMinor}.0-insiders.20231015`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -56564,7 +56564,12 @@ ${lanes.join("\n")}
56564
56564
  const checkType = type.checkType;
56565
56565
  const constraint = getLowerBoundOfKeyType(checkType);
56566
56566
  if (constraint !== checkType) {
56567
- return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
56567
+ return getConditionalTypeInstantiation(
56568
+ type,
56569
+ prependTypeMapping(type.root.checkType, constraint, type.mapper),
56570
+ /*forConstraint*/
56571
+ false
56572
+ );
56568
56573
  }
56569
56574
  }
56570
56575
  return type;
@@ -56916,7 +56921,12 @@ ${lanes.join("\n")}
56916
56921
  );
56917
56922
  const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;
56918
56923
  if (constraint && constraint !== type.checkType) {
56919
- const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
56924
+ const instantiated = getConditionalTypeInstantiation(
56925
+ type,
56926
+ prependTypeMapping(type.root.checkType, constraint, type.mapper),
56927
+ /*forConstraint*/
56928
+ true
56929
+ );
56920
56930
  if (!(instantiated.flags & 131072 /* Never */)) {
56921
56931
  type.resolvedConstraintOfDistributive = instantiated;
56922
56932
  return instantiated;
@@ -60479,7 +60489,7 @@ ${lanes.join("\n")}
60479
60489
  function isDeferredType(type, checkTuples) {
60480
60490
  return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
60481
60491
  }
60482
- function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
60492
+ function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
60483
60493
  let result;
60484
60494
  let extraTypes;
60485
60495
  let tailCount = 0;
@@ -60525,7 +60535,7 @@ ${lanes.join("\n")}
60525
60535
  const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
60526
60536
  if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
60527
60537
  if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
60528
- if (checkType.flags & 1 /* Any */) {
60538
+ if (checkType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
60529
60539
  (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
60530
60540
  }
60531
60541
  const falseType2 = getTypeFromTypeNode(root.node.falseType);
@@ -60635,7 +60645,9 @@ ${lanes.join("\n")}
60635
60645
  links.resolvedType = getConditionalType(
60636
60646
  root,
60637
60647
  /*mapper*/
60638
- void 0
60648
+ void 0,
60649
+ /*forConstraint*/
60650
+ false
60639
60651
  );
60640
60652
  if (outerTypeParameters) {
60641
60653
  root.instantiations = /* @__PURE__ */ new Map();
@@ -61489,17 +61501,17 @@ ${lanes.join("\n")}
61489
61501
  result.objectFlags |= result.aliasTypeArguments ? getPropagatingFlagsOfTypes(result.aliasTypeArguments) : 0;
61490
61502
  return result;
61491
61503
  }
61492
- function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
61504
+ function getConditionalTypeInstantiation(type, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
61493
61505
  const root = type.root;
61494
61506
  if (root.outerTypeParameters) {
61495
61507
  const typeArguments = map(root.outerTypeParameters, (t) => getMappedType(t, mapper));
61496
- const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
61508
+ const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
61497
61509
  let result = root.instantiations.get(id);
61498
61510
  if (!result) {
61499
61511
  const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
61500
61512
  const checkType = root.checkType;
61501
61513
  const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
61502
- result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper)), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);
61514
+ result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
61503
61515
  root.instantiations.set(id, result);
61504
61516
  }
61505
61517
  return result;
@@ -61587,7 +61599,14 @@ ${lanes.join("\n")}
61587
61599
  );
61588
61600
  }
61589
61601
  if (flags & 16777216 /* Conditional */) {
61590
- return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper), aliasSymbol, aliasTypeArguments);
61602
+ return getConditionalTypeInstantiation(
61603
+ type,
61604
+ combineTypeMappers(type.mapper, mapper),
61605
+ /*forConstraint*/
61606
+ false,
61607
+ aliasSymbol,
61608
+ aliasTypeArguments
61609
+ );
61591
61610
  }
61592
61611
  if (flags & 33554432 /* Substitution */) {
61593
61612
  const newBaseType = instantiateType(type.baseType, mapper);
@@ -64128,13 +64147,6 @@ ${lanes.join("\n")}
64128
64147
  return result2;
64129
64148
  }
64130
64149
  }
64131
- } else {
64132
- const distributiveConstraint = hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
64133
- if (distributiveConstraint) {
64134
- if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
64135
- return result2;
64136
- }
64137
- }
64138
64150
  }
64139
64151
  const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
64140
64152
  if (defaultConstraint) {
@@ -64142,6 +64154,13 @@ ${lanes.join("\n")}
64142
64154
  return result2;
64143
64155
  }
64144
64156
  }
64157
+ const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
64158
+ if (distributiveConstraint) {
64159
+ resetErrorInfo(saveErrorInfo);
64160
+ if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
64161
+ return result2;
64162
+ }
64163
+ }
64145
64164
  } else {
64146
64165
  if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) {
64147
64166
  return -1 /* True */;
@@ -71943,21 +71962,8 @@ ${lanes.join("\n")}
71943
71962
  function getEnclosingClassFromThisParameter(node) {
71944
71963
  const thisParameter = getThisParameterFromNodeContext(node);
71945
71964
  let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
71946
- if (thisType) {
71947
- if (thisType.flags & 262144 /* TypeParameter */) {
71948
- thisType = getConstraintOfTypeParameter(thisType);
71949
- }
71950
- } else {
71951
- const thisContainer = getThisContainer(
71952
- node,
71953
- /*includeArrowFunctions*/
71954
- false,
71955
- /*includeClassComputedPropertyName*/
71956
- false
71957
- );
71958
- if (isFunctionLike(thisContainer)) {
71959
- thisType = getContextualThisParameterType(thisContainer);
71960
- }
71965
+ if (thisType && thisType.flags & 262144 /* TypeParameter */) {
71966
+ thisType = getConstraintOfTypeParameter(thisType);
71961
71967
  }
71962
71968
  if (thisType && getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
71963
71969
  return getTargetType(thisType);
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.3";
57
- var version = `${versionMajorMinor}.0-insiders.20231013`;
57
+ var version = `${versionMajorMinor}.0-insiders.20231015`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
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.3.0-pr-56105-6",
5
+ "version": "5.3.0-pr-56004-36",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "566459088f5187e53c11777b58ecce6f3f3e0bea"
118
+ "gitHead": "8e340bfb738d84d6761c4fca509775563ce4d47f"
119
119
  }