@typescript-deploys/pr-build 6.0.0-pr-53017-28 → 6.0.0-pr-53017-35

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 = "6.0";
21
- var version = `${versionMajorMinor}.0-insiders.20251201`;
21
+ var version = `${versionMajorMinor}.0-insiders.20251202`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -68327,7 +68327,10 @@ function createTypeChecker(host) {
68327
68327
  }
68328
68328
  if (inference.indexes) {
68329
68329
  const eraseSelfMapper = makeArrayTypeMapper([constraint.type, typeParameter], [allKeysAllKeysUnknownType, stringNumberSymbolType]);
68330
- return instantiateType(getIntersectionType(inference.indexes), eraseSelfMapper);
68330
+ const aggregateInference = instantiateType(getIntersectionType(inference.indexes), eraseSelfMapper);
68331
+ if (!(getReducedType(aggregateInference).flags & 131072 /* Never */)) {
68332
+ return aggregateInference;
68333
+ }
68331
68334
  }
68332
68335
  return unknownType;
68333
68336
  }
@@ -68679,7 +68682,7 @@ function createTypeChecker(host) {
68679
68682
  if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
68680
68683
  return;
68681
68684
  }
68682
- if (!inference.isFixed) {
68685
+ if (!hasInferenceCandidates(inference)) {
68683
68686
  const partialInferenceTypeSymbol = getGlobalPartialInferenceSymbol();
68684
68687
  if (partialInferenceTypeSymbol) {
68685
68688
  if (target.indexType.flags & 465829888 /* Instantiable */) {
@@ -69199,52 +69202,63 @@ function createTypeChecker(host) {
69199
69202
  } else if (inference.indexes) {
69200
69203
  const eraseSelfMapper = makeUnaryTypeMapper(inference.typeParameter, allKeysUnknownType);
69201
69204
  let aggregateInference = instantiateType(getIntersectionType(inference.indexes), mergeTypeMappers(eraseSelfMapper, context.nonFixingMapper));
69205
+ if (getReducedType(aggregateInference).flags & 131072 /* Never */) {
69206
+ aggregateInference = void 0;
69207
+ }
69202
69208
  const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
69203
- if (constraint2) {
69209
+ if (aggregateInference && constraint2) {
69204
69210
  const instantiatedConstraint = instantiateType(constraint2, context.nonFixingMapper);
69205
- if (instantiatedConstraint.flags & 1048576 /* Union */ && !context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference))) {
69206
- const discriminantProps = findDiscriminantProperties(getPropertiesOfType(aggregateInference), instantiatedConstraint);
69207
- if (discriminantProps) {
69208
- let match;
69209
- findDiscriminant:
69210
- for (const p of discriminantProps) {
69211
- const candidatePropType = getTypeOfPropertyOfType(aggregateInference, p.escapedName);
69212
- for (const type of instantiatedConstraint.types) {
69213
- const propType = getTypeOfPropertyOfType(type, p.escapedName);
69214
- if (propType && candidatePropType && checkTypeAssignableTo(
69215
- candidatePropType,
69216
- propType,
69217
- /*errorNode*/
69218
- void 0
69219
- )) {
69220
- if (match && match !== type) {
69221
- match = void 0;
69222
- break findDiscriminant;
69223
- } else {
69224
- match = type;
69211
+ let assignableToConstraint = context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference));
69212
+ if (!assignableToConstraint) {
69213
+ if (instantiatedConstraint.flags & 1048576 /* Union */) {
69214
+ const discriminantProps = findDiscriminantProperties(getPropertiesOfType(aggregateInference), instantiatedConstraint);
69215
+ if (discriminantProps) {
69216
+ let match;
69217
+ findDiscriminant:
69218
+ for (const p of discriminantProps) {
69219
+ const candidatePropType = getTypeOfPropertyOfType(aggregateInference, p.escapedName);
69220
+ for (const type of instantiatedConstraint.types) {
69221
+ const propType = getTypeOfPropertyOfType(type, p.escapedName);
69222
+ if (propType && candidatePropType && checkTypeAssignableTo(
69223
+ candidatePropType,
69224
+ propType,
69225
+ /*errorNode*/
69226
+ void 0
69227
+ )) {
69228
+ if (match && match !== type) {
69229
+ match = void 0;
69230
+ break findDiscriminant;
69231
+ } else {
69232
+ match = type;
69233
+ }
69225
69234
  }
69226
69235
  }
69227
69236
  }
69237
+ if (match) {
69238
+ aggregateInference = getSpreadType(
69239
+ match,
69240
+ aggregateInference,
69241
+ /*symbol*/
69242
+ void 0,
69243
+ /*propegatedFlags*/
69244
+ 0,
69245
+ /*readonly*/
69246
+ false
69247
+ );
69248
+ assignableToConstraint = context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference));
69228
69249
  }
69229
- if (match) {
69230
- aggregateInference = getSpreadType(
69231
- match,
69232
- aggregateInference,
69233
- /*symbol*/
69234
- void 0,
69235
- /*propegatedFlags*/
69236
- 0,
69237
- /*readonly*/
69238
- false
69239
- );
69240
69250
  }
69241
69251
  }
69252
+ if (!assignableToConstraint) {
69253
+ aggregateInference = void 0;
69254
+ }
69242
69255
  }
69243
69256
  }
69244
69257
  inferredType = aggregateInference;
69245
69258
  } else if (context.flags & 1 /* NoDefault */) {
69246
69259
  inferredType = silentNeverType;
69247
- } else {
69260
+ }
69261
+ if (!inferredType) {
69248
69262
  const defaultType = getDefaultFromTypeParameter(inference.typeParameter);
69249
69263
  if (defaultType) {
69250
69264
  inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
package/lib/typescript.js CHANGED
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(typescript_exports);
2286
2286
 
2287
2287
  // src/compiler/corePublic.ts
2288
2288
  var versionMajorMinor = "6.0";
2289
- var version = `${versionMajorMinor}.0-insiders.20251201`;
2289
+ var version = `${versionMajorMinor}.0-insiders.20251202`;
2290
2290
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2291
2291
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2292
2292
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -72955,7 +72955,10 @@ function createTypeChecker(host) {
72955
72955
  }
72956
72956
  if (inference.indexes) {
72957
72957
  const eraseSelfMapper = makeArrayTypeMapper([constraint.type, typeParameter], [allKeysAllKeysUnknownType, stringNumberSymbolType]);
72958
- return instantiateType(getIntersectionType(inference.indexes), eraseSelfMapper);
72958
+ const aggregateInference = instantiateType(getIntersectionType(inference.indexes), eraseSelfMapper);
72959
+ if (!(getReducedType(aggregateInference).flags & 131072 /* Never */)) {
72960
+ return aggregateInference;
72961
+ }
72959
72962
  }
72960
72963
  return unknownType;
72961
72964
  }
@@ -73307,7 +73310,7 @@ function createTypeChecker(host) {
73307
73310
  if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
73308
73311
  return;
73309
73312
  }
73310
- if (!inference.isFixed) {
73313
+ if (!hasInferenceCandidates(inference)) {
73311
73314
  const partialInferenceTypeSymbol = getGlobalPartialInferenceSymbol();
73312
73315
  if (partialInferenceTypeSymbol) {
73313
73316
  if (target.indexType.flags & 465829888 /* Instantiable */) {
@@ -73827,52 +73830,63 @@ function createTypeChecker(host) {
73827
73830
  } else if (inference.indexes) {
73828
73831
  const eraseSelfMapper = makeUnaryTypeMapper(inference.typeParameter, allKeysUnknownType);
73829
73832
  let aggregateInference = instantiateType(getIntersectionType(inference.indexes), mergeTypeMappers(eraseSelfMapper, context.nonFixingMapper));
73833
+ if (getReducedType(aggregateInference).flags & 131072 /* Never */) {
73834
+ aggregateInference = void 0;
73835
+ }
73830
73836
  const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
73831
- if (constraint2) {
73837
+ if (aggregateInference && constraint2) {
73832
73838
  const instantiatedConstraint = instantiateType(constraint2, context.nonFixingMapper);
73833
- if (instantiatedConstraint.flags & 1048576 /* Union */ && !context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference))) {
73834
- const discriminantProps = findDiscriminantProperties(getPropertiesOfType(aggregateInference), instantiatedConstraint);
73835
- if (discriminantProps) {
73836
- let match;
73837
- findDiscriminant:
73838
- for (const p of discriminantProps) {
73839
- const candidatePropType = getTypeOfPropertyOfType(aggregateInference, p.escapedName);
73840
- for (const type of instantiatedConstraint.types) {
73841
- const propType = getTypeOfPropertyOfType(type, p.escapedName);
73842
- if (propType && candidatePropType && checkTypeAssignableTo(
73843
- candidatePropType,
73844
- propType,
73845
- /*errorNode*/
73846
- void 0
73847
- )) {
73848
- if (match && match !== type) {
73849
- match = void 0;
73850
- break findDiscriminant;
73851
- } else {
73852
- match = type;
73839
+ let assignableToConstraint = context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference));
73840
+ if (!assignableToConstraint) {
73841
+ if (instantiatedConstraint.flags & 1048576 /* Union */) {
73842
+ const discriminantProps = findDiscriminantProperties(getPropertiesOfType(aggregateInference), instantiatedConstraint);
73843
+ if (discriminantProps) {
73844
+ let match;
73845
+ findDiscriminant:
73846
+ for (const p of discriminantProps) {
73847
+ const candidatePropType = getTypeOfPropertyOfType(aggregateInference, p.escapedName);
73848
+ for (const type of instantiatedConstraint.types) {
73849
+ const propType = getTypeOfPropertyOfType(type, p.escapedName);
73850
+ if (propType && candidatePropType && checkTypeAssignableTo(
73851
+ candidatePropType,
73852
+ propType,
73853
+ /*errorNode*/
73854
+ void 0
73855
+ )) {
73856
+ if (match && match !== type) {
73857
+ match = void 0;
73858
+ break findDiscriminant;
73859
+ } else {
73860
+ match = type;
73861
+ }
73853
73862
  }
73854
73863
  }
73855
73864
  }
73865
+ if (match) {
73866
+ aggregateInference = getSpreadType(
73867
+ match,
73868
+ aggregateInference,
73869
+ /*symbol*/
73870
+ void 0,
73871
+ /*propegatedFlags*/
73872
+ 0,
73873
+ /*readonly*/
73874
+ false
73875
+ );
73876
+ assignableToConstraint = context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference));
73856
73877
  }
73857
- if (match) {
73858
- aggregateInference = getSpreadType(
73859
- match,
73860
- aggregateInference,
73861
- /*symbol*/
73862
- void 0,
73863
- /*propegatedFlags*/
73864
- 0,
73865
- /*readonly*/
73866
- false
73867
- );
73868
73878
  }
73869
73879
  }
73880
+ if (!assignableToConstraint) {
73881
+ aggregateInference = void 0;
73882
+ }
73870
73883
  }
73871
73884
  }
73872
73885
  inferredType = aggregateInference;
73873
73886
  } else if (context.flags & 1 /* NoDefault */) {
73874
73887
  inferredType = silentNeverType;
73875
- } else {
73888
+ }
73889
+ if (!inferredType) {
73876
73890
  const defaultType = getDefaultFromTypeParameter(inference.typeParameter);
73877
73891
  if (defaultType) {
73878
73892
  inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
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": "6.0.0-pr-53017-28",
5
+ "version": "6.0.0-pr-53017-35",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [