@typescript-deploys/pr-build 6.0.0-pr-53017-35 → 6.0.0-pr-61999-2

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/SECURITY.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Security
4
4
 
5
- Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
5
+ Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.
6
6
 
7
7
  If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8
8
 
@@ -12,9 +12,7 @@ If you believe you have found a security vulnerability in any Microsoft-owned re
12
12
 
13
13
  Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14
14
 
15
- If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16
-
17
- You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
15
+ You should receive a response within 24 hours. If for some reason you do not, please follow up using the messaging functionality found at the bottom of the Activity tab on your vulnerability report on [https://msrc.microsoft.com/report/vulnerability](https://msrc.microsoft.com/report/vulnerability/) or via email as described in the instructions at the bottom of [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc) or on MSRC's [FAQ page for reporting an issue](https://www.microsoft.com/en-us/msrc/faqs-report-an-issue).
18
16
 
19
17
  Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
18
 
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.20251202`;
21
+ var version = `${versionMajorMinor}.0-insiders.20251204`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -47075,32 +47075,6 @@ function createTypeChecker(host) {
47075
47075
  emptyArray
47076
47076
  );
47077
47077
  var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType;
47078
- var allKeysUnknownType = createAnonymousType(
47079
- /*symbol*/
47080
- void 0,
47081
- emptySymbols,
47082
- emptyArray,
47083
- emptyArray,
47084
- map(stringNumberSymbolType.types, (t) => createIndexInfo(
47085
- t,
47086
- unknownType,
47087
- /*isReadonly*/
47088
- false
47089
- ))
47090
- );
47091
- var allKeysAllKeysUnknownType = createAnonymousType(
47092
- /*symbol*/
47093
- void 0,
47094
- emptySymbols,
47095
- emptyArray,
47096
- emptyArray,
47097
- map(stringNumberSymbolType.types, (t) => createIndexInfo(
47098
- t,
47099
- allKeysUnknownType,
47100
- /*isReadonly*/
47101
- false
47102
- ))
47103
- );
47104
47078
  var emptyGenericType = createAnonymousType(
47105
47079
  /*symbol*/
47106
47080
  void 0,
@@ -47319,7 +47293,6 @@ function createTypeChecker(host) {
47319
47293
  var deferredGlobalBigIntType;
47320
47294
  var deferredGlobalNaNSymbol;
47321
47295
  var deferredGlobalRecordSymbol;
47322
- var deferredGlobalPartialInferenceSymbol;
47323
47296
  var deferredGlobalClassDecoratorContextType;
47324
47297
  var deferredGlobalClassMethodDecoratorContextType;
47325
47298
  var deferredGlobalClassGetterDecoratorContextType;
@@ -58326,8 +58299,15 @@ function createTypeChecker(host) {
58326
58299
  inferredProp.declarations = prop.declarations;
58327
58300
  inferredProp.links.nameType = getSymbolLinks(prop).nameType;
58328
58301
  inferredProp.links.propertyType = getTypeOfSymbol(prop);
58329
- inferredProp.links.mappedType = type.mappedType;
58330
- inferredProp.links.constraintType = type.constraintType;
58302
+ if (type.constraintType.type.flags & 8388608 /* IndexedAccess */ && type.constraintType.type.objectType.flags & 262144 /* TypeParameter */ && type.constraintType.type.indexType.flags & 262144 /* TypeParameter */) {
58303
+ const newTypeParam = type.constraintType.type.objectType;
58304
+ const newMappedType = replaceIndexedAccess(type.mappedType, type.constraintType.type, newTypeParam);
58305
+ inferredProp.links.mappedType = newMappedType;
58306
+ inferredProp.links.constraintType = getIndexType(newTypeParam);
58307
+ } else {
58308
+ inferredProp.links.mappedType = type.mappedType;
58309
+ inferredProp.links.constraintType = type.constraintType;
58310
+ }
58331
58311
  members.set(prop.escapedName, inferredProp);
58332
58312
  }
58333
58313
  setStructuredTypeMembers(type, members, emptyArray, emptyArray, indexInfos);
@@ -60896,16 +60876,6 @@ function createTypeChecker(host) {
60896
60876
  ) || unknownSymbol);
60897
60877
  return deferredGlobalRecordSymbol === unknownSymbol ? void 0 : deferredGlobalRecordSymbol;
60898
60878
  }
60899
- function getGlobalPartialInferenceSymbol() {
60900
- deferredGlobalPartialInferenceSymbol || (deferredGlobalPartialInferenceSymbol = getGlobalTypeAliasSymbol(
60901
- "PartialInference",
60902
- /*arity*/
60903
- 2,
60904
- /*reportErrors*/
60905
- false
60906
- ) || unknownSymbol);
60907
- return deferredGlobalPartialInferenceSymbol === unknownSymbol ? void 0 : deferredGlobalPartialInferenceSymbol;
60908
- }
60909
60879
  function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) {
60910
60880
  return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType;
60911
60881
  }
@@ -61905,7 +61875,7 @@ function createTypeChecker(host) {
61905
61875
  }
61906
61876
  function getIndexType(type, indexFlags = 0 /* None */) {
61907
61877
  type = getReducedType(type);
61908
- return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
61878
+ return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : type.flags & 33554432 /* Substitution */ && !isGenericType(type.baseType) && !isGenericType(type.constraint) ? getUnionType([getIndexType(type.baseType, indexFlags), getIndexType(type.constraint, indexFlags)]) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
61909
61879
  }
61910
61880
  function getExtractStringType(type) {
61911
61881
  const extractTypeAlias = getGlobalExtractSymbol();
@@ -68183,8 +68153,7 @@ function createTypeChecker(host) {
68183
68153
  priority: void 0,
68184
68154
  topLevel: true,
68185
68155
  isFixed: false,
68186
- impliedArity: void 0,
68187
- indexes: void 0
68156
+ impliedArity: void 0
68188
68157
  };
68189
68158
  }
68190
68159
  function cloneInferenceInfo(inference) {
@@ -68196,8 +68165,7 @@ function createTypeChecker(host) {
68196
68165
  priority: inference.priority,
68197
68166
  topLevel: inference.topLevel,
68198
68167
  isFixed: inference.isFixed,
68199
- impliedArity: inference.impliedArity,
68200
- indexes: inference.indexes && inference.indexes.slice()
68168
+ impliedArity: inference.impliedArity
68201
68169
  };
68202
68170
  }
68203
68171
  function cloneInferredPartOfContext(context) {
@@ -68263,11 +68231,6 @@ function createTypeChecker(host) {
68263
68231
  );
68264
68232
  }
68265
68233
  function inferTypeForHomomorphicMappedType(source, target, constraint) {
68266
- if (constraint.type.flags & 8388608 /* IndexedAccess */) {
68267
- const newTypeParam = constraint.type.objectType;
68268
- target = replaceIndexedAccess(target, constraint.type, newTypeParam);
68269
- constraint = getIndexType(newTypeParam);
68270
- }
68271
68234
  const cacheKey = source.id + "," + target.id + "," + constraint.id;
68272
68235
  if (reverseHomomorphicMappedCache.has(cacheKey)) {
68273
68236
  return reverseHomomorphicMappedCache.get(cacheKey);
@@ -68316,23 +68279,11 @@ function createTypeChecker(host) {
68316
68279
  return links.type;
68317
68280
  }
68318
68281
  function inferReverseMappedTypeWorker(sourceType, target, constraint) {
68319
- const typeParameter = getTypeParameterFromMappedType(target);
68320
- const inferenceTarget = getIndexedAccessType(constraint.type, typeParameter);
68282
+ const typeParameter = getIndexedAccessType(constraint.type, getTypeParameterFromMappedType(target));
68321
68283
  const templateType = getTemplateTypeFromMappedType(target);
68322
- const inference = createInferenceInfo(inferenceTarget);
68284
+ const inference = createInferenceInfo(typeParameter);
68323
68285
  inferTypes([inference], sourceType, templateType);
68324
- const inferredType = getTypeFromInference(inference);
68325
- if (inferredType) {
68326
- return inferredType;
68327
- }
68328
- if (inference.indexes) {
68329
- const eraseSelfMapper = makeArrayTypeMapper([constraint.type, typeParameter], [allKeysAllKeysUnknownType, stringNumberSymbolType]);
68330
- const aggregateInference = instantiateType(getIntersectionType(inference.indexes), eraseSelfMapper);
68331
- if (!(getReducedType(aggregateInference).flags & 131072 /* Never */)) {
68332
- return aggregateInference;
68333
- }
68334
- }
68335
- return unknownType;
68286
+ return getTypeFromInference(inference) || unknownType;
68336
68287
  }
68337
68288
  function inferReverseMappedType(source, target, constraint) {
68338
68289
  const cacheKey = source.id + "," + target.id + "," + constraint.id;
@@ -68673,29 +68624,6 @@ function createTypeChecker(host) {
68673
68624
  } else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
68674
68625
  inferFromTypes(source.objectType, target.objectType);
68675
68626
  inferFromTypes(source.indexType, target.indexType);
68676
- } else if (!(priority & 1 /* NakedTypeVariable */) && target.flags & 8388608 /* IndexedAccess */) {
68677
- if (isFromInferenceBlockedSource(source)) {
68678
- return;
68679
- }
68680
- const inference = getInferenceInfoForType(getActualTypeVariable(target.objectType));
68681
- if (inference) {
68682
- if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
68683
- return;
68684
- }
68685
- if (!hasInferenceCandidates(inference)) {
68686
- const partialInferenceTypeSymbol = getGlobalPartialInferenceSymbol();
68687
- if (partialInferenceTypeSymbol) {
68688
- if (target.indexType.flags & 465829888 /* Instantiable */) {
68689
- const recordSymbol = getGlobalRecordSymbol();
68690
- if (recordSymbol) {
68691
- inference.indexes = append(inference.indexes, getTypeAliasInstantiation(recordSymbol, [target.indexType, source]));
68692
- }
68693
- } else {
68694
- inference.indexes = append(inference.indexes, getTypeAliasInstantiation(partialInferenceTypeSymbol, [source, target.indexType]));
68695
- }
68696
- }
68697
- }
68698
- }
68699
68627
  } else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) {
68700
68628
  if (source.symbol === target.symbol) {
68701
68629
  inferFromTypes(source.type, target.type);
@@ -69199,66 +69127,9 @@ function createTypeChecker(host) {
69199
69127
  const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
69200
69128
  inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
69201
69129
  fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
69202
- } else if (inference.indexes) {
69203
- const eraseSelfMapper = makeUnaryTypeMapper(inference.typeParameter, allKeysUnknownType);
69204
- let aggregateInference = instantiateType(getIntersectionType(inference.indexes), mergeTypeMappers(eraseSelfMapper, context.nonFixingMapper));
69205
- if (getReducedType(aggregateInference).flags & 131072 /* Never */) {
69206
- aggregateInference = void 0;
69207
- }
69208
- const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
69209
- if (aggregateInference && constraint2) {
69210
- const instantiatedConstraint = instantiateType(constraint2, context.nonFixingMapper);
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
- }
69234
- }
69235
- }
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));
69249
- }
69250
- }
69251
- }
69252
- if (!assignableToConstraint) {
69253
- aggregateInference = void 0;
69254
- }
69255
- }
69256
- }
69257
- inferredType = aggregateInference;
69258
69130
  } else if (context.flags & 1 /* NoDefault */) {
69259
69131
  inferredType = silentNeverType;
69260
- }
69261
- if (!inferredType) {
69132
+ } else {
69262
69133
  const defaultType = getDefaultFromTypeParameter(inference.typeParameter);
69263
69134
  if (defaultType) {
69264
69135
  inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
@@ -69271,9 +69142,17 @@ function createTypeChecker(host) {
69271
69142
  const constraint = getConstraintOfTypeParameter(inference.typeParameter);
69272
69143
  if (constraint) {
69273
69144
  const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
69274
- if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
69275
- inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
69145
+ if (inferredType) {
69146
+ const constraintWithThis = getTypeWithThisArgument(instantiatedConstraint, inferredType);
69147
+ if (!context.compareTypes(inferredType, constraintWithThis)) {
69148
+ const filteredByConstraint = inference.priority === 128 /* ReturnType */ ? filterType(inferredType, (t) => !!context.compareTypes(t, constraintWithThis)) : neverType;
69149
+ inferredType = !(filteredByConstraint.flags & 131072 /* Never */) ? filteredByConstraint : void 0;
69150
+ }
69151
+ }
69152
+ if (!inferredType) {
69153
+ inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
69276
69154
  }
69155
+ inference.inferredType = inferredType;
69277
69156
  }
69278
69157
  clearActiveMapperCaches();
69279
69158
  }
package/lib/lib.es5.d.ts CHANGED
@@ -1682,15 +1682,6 @@ type NoInfer<T> = intrinsic;
1682
1682
  */
1683
1683
  interface ThisType<T> {}
1684
1684
 
1685
- /**
1686
- * Type instantiated to perform partial inferences from indexed accesses
1687
- */
1688
- type PartialInference<T, Keys extends PropertyKey> = ({
1689
- [K in Keys]: {
1690
- [K1 in K]: T;
1691
- };
1692
- })[Keys];
1693
-
1694
1685
  /**
1695
1686
  * Stores types to be used with WeakSet, WeakMap, WeakRef, and FinalizationRegistry
1696
1687
  */
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.20251202`;
2289
+ var version = `${versionMajorMinor}.0-insiders.20251204`;
2290
2290
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2291
2291
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2292
2292
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -51703,32 +51703,6 @@ function createTypeChecker(host) {
51703
51703
  emptyArray
51704
51704
  );
51705
51705
  var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType;
51706
- var allKeysUnknownType = createAnonymousType(
51707
- /*symbol*/
51708
- void 0,
51709
- emptySymbols,
51710
- emptyArray,
51711
- emptyArray,
51712
- map(stringNumberSymbolType.types, (t) => createIndexInfo(
51713
- t,
51714
- unknownType,
51715
- /*isReadonly*/
51716
- false
51717
- ))
51718
- );
51719
- var allKeysAllKeysUnknownType = createAnonymousType(
51720
- /*symbol*/
51721
- void 0,
51722
- emptySymbols,
51723
- emptyArray,
51724
- emptyArray,
51725
- map(stringNumberSymbolType.types, (t) => createIndexInfo(
51726
- t,
51727
- allKeysUnknownType,
51728
- /*isReadonly*/
51729
- false
51730
- ))
51731
- );
51732
51706
  var emptyGenericType = createAnonymousType(
51733
51707
  /*symbol*/
51734
51708
  void 0,
@@ -51947,7 +51921,6 @@ function createTypeChecker(host) {
51947
51921
  var deferredGlobalBigIntType;
51948
51922
  var deferredGlobalNaNSymbol;
51949
51923
  var deferredGlobalRecordSymbol;
51950
- var deferredGlobalPartialInferenceSymbol;
51951
51924
  var deferredGlobalClassDecoratorContextType;
51952
51925
  var deferredGlobalClassMethodDecoratorContextType;
51953
51926
  var deferredGlobalClassGetterDecoratorContextType;
@@ -62954,8 +62927,15 @@ function createTypeChecker(host) {
62954
62927
  inferredProp.declarations = prop.declarations;
62955
62928
  inferredProp.links.nameType = getSymbolLinks(prop).nameType;
62956
62929
  inferredProp.links.propertyType = getTypeOfSymbol(prop);
62957
- inferredProp.links.mappedType = type.mappedType;
62958
- inferredProp.links.constraintType = type.constraintType;
62930
+ if (type.constraintType.type.flags & 8388608 /* IndexedAccess */ && type.constraintType.type.objectType.flags & 262144 /* TypeParameter */ && type.constraintType.type.indexType.flags & 262144 /* TypeParameter */) {
62931
+ const newTypeParam = type.constraintType.type.objectType;
62932
+ const newMappedType = replaceIndexedAccess(type.mappedType, type.constraintType.type, newTypeParam);
62933
+ inferredProp.links.mappedType = newMappedType;
62934
+ inferredProp.links.constraintType = getIndexType(newTypeParam);
62935
+ } else {
62936
+ inferredProp.links.mappedType = type.mappedType;
62937
+ inferredProp.links.constraintType = type.constraintType;
62938
+ }
62959
62939
  members.set(prop.escapedName, inferredProp);
62960
62940
  }
62961
62941
  setStructuredTypeMembers(type, members, emptyArray, emptyArray, indexInfos);
@@ -65524,16 +65504,6 @@ function createTypeChecker(host) {
65524
65504
  ) || unknownSymbol);
65525
65505
  return deferredGlobalRecordSymbol === unknownSymbol ? void 0 : deferredGlobalRecordSymbol;
65526
65506
  }
65527
- function getGlobalPartialInferenceSymbol() {
65528
- deferredGlobalPartialInferenceSymbol || (deferredGlobalPartialInferenceSymbol = getGlobalTypeAliasSymbol(
65529
- "PartialInference",
65530
- /*arity*/
65531
- 2,
65532
- /*reportErrors*/
65533
- false
65534
- ) || unknownSymbol);
65535
- return deferredGlobalPartialInferenceSymbol === unknownSymbol ? void 0 : deferredGlobalPartialInferenceSymbol;
65536
- }
65537
65507
  function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) {
65538
65508
  return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType;
65539
65509
  }
@@ -66533,7 +66503,7 @@ function createTypeChecker(host) {
66533
66503
  }
66534
66504
  function getIndexType(type, indexFlags = 0 /* None */) {
66535
66505
  type = getReducedType(type);
66536
- return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
66506
+ return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : type.flags & 33554432 /* Substitution */ && !isGenericType(type.baseType) && !isGenericType(type.constraint) ? getUnionType([getIndexType(type.baseType, indexFlags), getIndexType(type.constraint, indexFlags)]) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
66537
66507
  }
66538
66508
  function getExtractStringType(type) {
66539
66509
  const extractTypeAlias = getGlobalExtractSymbol();
@@ -72811,8 +72781,7 @@ function createTypeChecker(host) {
72811
72781
  priority: void 0,
72812
72782
  topLevel: true,
72813
72783
  isFixed: false,
72814
- impliedArity: void 0,
72815
- indexes: void 0
72784
+ impliedArity: void 0
72816
72785
  };
72817
72786
  }
72818
72787
  function cloneInferenceInfo(inference) {
@@ -72824,8 +72793,7 @@ function createTypeChecker(host) {
72824
72793
  priority: inference.priority,
72825
72794
  topLevel: inference.topLevel,
72826
72795
  isFixed: inference.isFixed,
72827
- impliedArity: inference.impliedArity,
72828
- indexes: inference.indexes && inference.indexes.slice()
72796
+ impliedArity: inference.impliedArity
72829
72797
  };
72830
72798
  }
72831
72799
  function cloneInferredPartOfContext(context) {
@@ -72891,11 +72859,6 @@ function createTypeChecker(host) {
72891
72859
  );
72892
72860
  }
72893
72861
  function inferTypeForHomomorphicMappedType(source, target, constraint) {
72894
- if (constraint.type.flags & 8388608 /* IndexedAccess */) {
72895
- const newTypeParam = constraint.type.objectType;
72896
- target = replaceIndexedAccess(target, constraint.type, newTypeParam);
72897
- constraint = getIndexType(newTypeParam);
72898
- }
72899
72862
  const cacheKey = source.id + "," + target.id + "," + constraint.id;
72900
72863
  if (reverseHomomorphicMappedCache.has(cacheKey)) {
72901
72864
  return reverseHomomorphicMappedCache.get(cacheKey);
@@ -72944,23 +72907,11 @@ function createTypeChecker(host) {
72944
72907
  return links.type;
72945
72908
  }
72946
72909
  function inferReverseMappedTypeWorker(sourceType, target, constraint) {
72947
- const typeParameter = getTypeParameterFromMappedType(target);
72948
- const inferenceTarget = getIndexedAccessType(constraint.type, typeParameter);
72910
+ const typeParameter = getIndexedAccessType(constraint.type, getTypeParameterFromMappedType(target));
72949
72911
  const templateType = getTemplateTypeFromMappedType(target);
72950
- const inference = createInferenceInfo(inferenceTarget);
72912
+ const inference = createInferenceInfo(typeParameter);
72951
72913
  inferTypes([inference], sourceType, templateType);
72952
- const inferredType = getTypeFromInference(inference);
72953
- if (inferredType) {
72954
- return inferredType;
72955
- }
72956
- if (inference.indexes) {
72957
- const eraseSelfMapper = makeArrayTypeMapper([constraint.type, typeParameter], [allKeysAllKeysUnknownType, stringNumberSymbolType]);
72958
- const aggregateInference = instantiateType(getIntersectionType(inference.indexes), eraseSelfMapper);
72959
- if (!(getReducedType(aggregateInference).flags & 131072 /* Never */)) {
72960
- return aggregateInference;
72961
- }
72962
- }
72963
- return unknownType;
72914
+ return getTypeFromInference(inference) || unknownType;
72964
72915
  }
72965
72916
  function inferReverseMappedType(source, target, constraint) {
72966
72917
  const cacheKey = source.id + "," + target.id + "," + constraint.id;
@@ -73301,29 +73252,6 @@ function createTypeChecker(host) {
73301
73252
  } else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
73302
73253
  inferFromTypes(source.objectType, target.objectType);
73303
73254
  inferFromTypes(source.indexType, target.indexType);
73304
- } else if (!(priority & 1 /* NakedTypeVariable */) && target.flags & 8388608 /* IndexedAccess */) {
73305
- if (isFromInferenceBlockedSource(source)) {
73306
- return;
73307
- }
73308
- const inference = getInferenceInfoForType(getActualTypeVariable(target.objectType));
73309
- if (inference) {
73310
- if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
73311
- return;
73312
- }
73313
- if (!hasInferenceCandidates(inference)) {
73314
- const partialInferenceTypeSymbol = getGlobalPartialInferenceSymbol();
73315
- if (partialInferenceTypeSymbol) {
73316
- if (target.indexType.flags & 465829888 /* Instantiable */) {
73317
- const recordSymbol = getGlobalRecordSymbol();
73318
- if (recordSymbol) {
73319
- inference.indexes = append(inference.indexes, getTypeAliasInstantiation(recordSymbol, [target.indexType, source]));
73320
- }
73321
- } else {
73322
- inference.indexes = append(inference.indexes, getTypeAliasInstantiation(partialInferenceTypeSymbol, [source, target.indexType]));
73323
- }
73324
- }
73325
- }
73326
- }
73327
73255
  } else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) {
73328
73256
  if (source.symbol === target.symbol) {
73329
73257
  inferFromTypes(source.type, target.type);
@@ -73827,66 +73755,9 @@ function createTypeChecker(host) {
73827
73755
  const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
73828
73756
  inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
73829
73757
  fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
73830
- } else if (inference.indexes) {
73831
- const eraseSelfMapper = makeUnaryTypeMapper(inference.typeParameter, allKeysUnknownType);
73832
- let aggregateInference = instantiateType(getIntersectionType(inference.indexes), mergeTypeMappers(eraseSelfMapper, context.nonFixingMapper));
73833
- if (getReducedType(aggregateInference).flags & 131072 /* Never */) {
73834
- aggregateInference = void 0;
73835
- }
73836
- const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
73837
- if (aggregateInference && constraint2) {
73838
- const instantiatedConstraint = instantiateType(constraint2, context.nonFixingMapper);
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
- }
73862
- }
73863
- }
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));
73877
- }
73878
- }
73879
- }
73880
- if (!assignableToConstraint) {
73881
- aggregateInference = void 0;
73882
- }
73883
- }
73884
- }
73885
- inferredType = aggregateInference;
73886
73758
  } else if (context.flags & 1 /* NoDefault */) {
73887
73759
  inferredType = silentNeverType;
73888
- }
73889
- if (!inferredType) {
73760
+ } else {
73890
73761
  const defaultType = getDefaultFromTypeParameter(inference.typeParameter);
73891
73762
  if (defaultType) {
73892
73763
  inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
@@ -73899,9 +73770,17 @@ function createTypeChecker(host) {
73899
73770
  const constraint = getConstraintOfTypeParameter(inference.typeParameter);
73900
73771
  if (constraint) {
73901
73772
  const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
73902
- if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
73903
- inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
73773
+ if (inferredType) {
73774
+ const constraintWithThis = getTypeWithThisArgument(instantiatedConstraint, inferredType);
73775
+ if (!context.compareTypes(inferredType, constraintWithThis)) {
73776
+ const filteredByConstraint = inference.priority === 128 /* ReturnType */ ? filterType(inferredType, (t) => !!context.compareTypes(t, constraintWithThis)) : neverType;
73777
+ inferredType = !(filteredByConstraint.flags & 131072 /* Never */) ? filteredByConstraint : void 0;
73778
+ }
73779
+ }
73780
+ if (!inferredType) {
73781
+ inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
73904
73782
  }
73783
+ inference.inferredType = inferredType;
73905
73784
  }
73906
73785
  clearActiveMapperCaches();
73907
73786
  }
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-35",
5
+ "version": "6.0.0-pr-61999-2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [