@typescript-deploys/pr-build 6.0.0-pr-53017-28 → 6.0.0-pr-58910-25
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 +25 -132
- package/lib/lib.es5.d.ts +0 -9
- package/lib/typescript.js +25 -132
- package/package.json +1 -1
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.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20251203`;
|
|
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
|
-
|
|
58330
|
-
|
|
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
|
}
|
|
@@ -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,20 +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(
|
|
68284
|
+
const inference = createInferenceInfo(typeParameter);
|
|
68323
68285
|
inferTypes([inference], sourceType, templateType);
|
|
68324
|
-
|
|
68325
|
-
if (inferredType) {
|
|
68326
|
-
return inferredType;
|
|
68327
|
-
}
|
|
68328
|
-
if (inference.indexes) {
|
|
68329
|
-
const eraseSelfMapper = makeArrayTypeMapper([constraint.type, typeParameter], [allKeysAllKeysUnknownType, stringNumberSymbolType]);
|
|
68330
|
-
return instantiateType(getIntersectionType(inference.indexes), eraseSelfMapper);
|
|
68331
|
-
}
|
|
68332
|
-
return unknownType;
|
|
68286
|
+
return getTypeFromInference(inference) || unknownType;
|
|
68333
68287
|
}
|
|
68334
68288
|
function inferReverseMappedType(source, target, constraint) {
|
|
68335
68289
|
const cacheKey = source.id + "," + target.id + "," + constraint.id;
|
|
@@ -68670,29 +68624,6 @@ function createTypeChecker(host) {
|
|
|
68670
68624
|
} else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
|
|
68671
68625
|
inferFromTypes(source.objectType, target.objectType);
|
|
68672
68626
|
inferFromTypes(source.indexType, target.indexType);
|
|
68673
|
-
} else if (!(priority & 1 /* NakedTypeVariable */) && target.flags & 8388608 /* IndexedAccess */) {
|
|
68674
|
-
if (isFromInferenceBlockedSource(source)) {
|
|
68675
|
-
return;
|
|
68676
|
-
}
|
|
68677
|
-
const inference = getInferenceInfoForType(getActualTypeVariable(target.objectType));
|
|
68678
|
-
if (inference) {
|
|
68679
|
-
if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
68680
|
-
return;
|
|
68681
|
-
}
|
|
68682
|
-
if (!inference.isFixed) {
|
|
68683
|
-
const partialInferenceTypeSymbol = getGlobalPartialInferenceSymbol();
|
|
68684
|
-
if (partialInferenceTypeSymbol) {
|
|
68685
|
-
if (target.indexType.flags & 465829888 /* Instantiable */) {
|
|
68686
|
-
const recordSymbol = getGlobalRecordSymbol();
|
|
68687
|
-
if (recordSymbol) {
|
|
68688
|
-
inference.indexes = append(inference.indexes, getTypeAliasInstantiation(recordSymbol, [target.indexType, source]));
|
|
68689
|
-
}
|
|
68690
|
-
} else {
|
|
68691
|
-
inference.indexes = append(inference.indexes, getTypeAliasInstantiation(partialInferenceTypeSymbol, [source, target.indexType]));
|
|
68692
|
-
}
|
|
68693
|
-
}
|
|
68694
|
-
}
|
|
68695
|
-
}
|
|
68696
68627
|
} else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) {
|
|
68697
68628
|
if (source.symbol === target.symbol) {
|
|
68698
68629
|
inferFromTypes(source.type, target.type);
|
|
@@ -69196,52 +69127,6 @@ function createTypeChecker(host) {
|
|
|
69196
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))));
|
|
69197
69128
|
inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
|
|
69198
69129
|
fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
|
|
69199
|
-
} else if (inference.indexes) {
|
|
69200
|
-
const eraseSelfMapper = makeUnaryTypeMapper(inference.typeParameter, allKeysUnknownType);
|
|
69201
|
-
let aggregateInference = instantiateType(getIntersectionType(inference.indexes), mergeTypeMappers(eraseSelfMapper, context.nonFixingMapper));
|
|
69202
|
-
const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
|
|
69203
|
-
if (constraint2) {
|
|
69204
|
-
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;
|
|
69225
|
-
}
|
|
69226
|
-
}
|
|
69227
|
-
}
|
|
69228
|
-
}
|
|
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
|
-
}
|
|
69241
|
-
}
|
|
69242
|
-
}
|
|
69243
|
-
}
|
|
69244
|
-
inferredType = aggregateInference;
|
|
69245
69130
|
} else if (context.flags & 1 /* NoDefault */) {
|
|
69246
69131
|
inferredType = silentNeverType;
|
|
69247
69132
|
} else {
|
|
@@ -69257,9 +69142,17 @@ function createTypeChecker(host) {
|
|
|
69257
69142
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
69258
69143
|
if (constraint) {
|
|
69259
69144
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
69260
|
-
if (
|
|
69261
|
-
|
|
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;
|
|
69262
69154
|
}
|
|
69155
|
+
inference.inferredType = inferredType;
|
|
69263
69156
|
}
|
|
69264
69157
|
clearActiveMapperCaches();
|
|
69265
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.
|
|
2289
|
+
var version = `${versionMajorMinor}.0-insiders.20251203`;
|
|
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
|
-
|
|
62958
|
-
|
|
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
|
}
|
|
@@ -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,20 +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(
|
|
72912
|
+
const inference = createInferenceInfo(typeParameter);
|
|
72951
72913
|
inferTypes([inference], sourceType, templateType);
|
|
72952
|
-
|
|
72953
|
-
if (inferredType) {
|
|
72954
|
-
return inferredType;
|
|
72955
|
-
}
|
|
72956
|
-
if (inference.indexes) {
|
|
72957
|
-
const eraseSelfMapper = makeArrayTypeMapper([constraint.type, typeParameter], [allKeysAllKeysUnknownType, stringNumberSymbolType]);
|
|
72958
|
-
return instantiateType(getIntersectionType(inference.indexes), eraseSelfMapper);
|
|
72959
|
-
}
|
|
72960
|
-
return unknownType;
|
|
72914
|
+
return getTypeFromInference(inference) || unknownType;
|
|
72961
72915
|
}
|
|
72962
72916
|
function inferReverseMappedType(source, target, constraint) {
|
|
72963
72917
|
const cacheKey = source.id + "," + target.id + "," + constraint.id;
|
|
@@ -73298,29 +73252,6 @@ function createTypeChecker(host) {
|
|
|
73298
73252
|
} else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
|
|
73299
73253
|
inferFromTypes(source.objectType, target.objectType);
|
|
73300
73254
|
inferFromTypes(source.indexType, target.indexType);
|
|
73301
|
-
} else if (!(priority & 1 /* NakedTypeVariable */) && target.flags & 8388608 /* IndexedAccess */) {
|
|
73302
|
-
if (isFromInferenceBlockedSource(source)) {
|
|
73303
|
-
return;
|
|
73304
|
-
}
|
|
73305
|
-
const inference = getInferenceInfoForType(getActualTypeVariable(target.objectType));
|
|
73306
|
-
if (inference) {
|
|
73307
|
-
if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
73308
|
-
return;
|
|
73309
|
-
}
|
|
73310
|
-
if (!inference.isFixed) {
|
|
73311
|
-
const partialInferenceTypeSymbol = getGlobalPartialInferenceSymbol();
|
|
73312
|
-
if (partialInferenceTypeSymbol) {
|
|
73313
|
-
if (target.indexType.flags & 465829888 /* Instantiable */) {
|
|
73314
|
-
const recordSymbol = getGlobalRecordSymbol();
|
|
73315
|
-
if (recordSymbol) {
|
|
73316
|
-
inference.indexes = append(inference.indexes, getTypeAliasInstantiation(recordSymbol, [target.indexType, source]));
|
|
73317
|
-
}
|
|
73318
|
-
} else {
|
|
73319
|
-
inference.indexes = append(inference.indexes, getTypeAliasInstantiation(partialInferenceTypeSymbol, [source, target.indexType]));
|
|
73320
|
-
}
|
|
73321
|
-
}
|
|
73322
|
-
}
|
|
73323
|
-
}
|
|
73324
73255
|
} else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) {
|
|
73325
73256
|
if (source.symbol === target.symbol) {
|
|
73326
73257
|
inferFromTypes(source.type, target.type);
|
|
@@ -73824,52 +73755,6 @@ function createTypeChecker(host) {
|
|
|
73824
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))));
|
|
73825
73756
|
inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
|
|
73826
73757
|
fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
|
|
73827
|
-
} else if (inference.indexes) {
|
|
73828
|
-
const eraseSelfMapper = makeUnaryTypeMapper(inference.typeParameter, allKeysUnknownType);
|
|
73829
|
-
let aggregateInference = instantiateType(getIntersectionType(inference.indexes), mergeTypeMappers(eraseSelfMapper, context.nonFixingMapper));
|
|
73830
|
-
const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
|
|
73831
|
-
if (constraint2) {
|
|
73832
|
-
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;
|
|
73853
|
-
}
|
|
73854
|
-
}
|
|
73855
|
-
}
|
|
73856
|
-
}
|
|
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
|
-
}
|
|
73869
|
-
}
|
|
73870
|
-
}
|
|
73871
|
-
}
|
|
73872
|
-
inferredType = aggregateInference;
|
|
73873
73758
|
} else if (context.flags & 1 /* NoDefault */) {
|
|
73874
73759
|
inferredType = silentNeverType;
|
|
73875
73760
|
} else {
|
|
@@ -73885,9 +73770,17 @@ function createTypeChecker(host) {
|
|
|
73885
73770
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
73886
73771
|
if (constraint) {
|
|
73887
73772
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
73888
|
-
if (
|
|
73889
|
-
|
|
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;
|
|
73890
73782
|
}
|
|
73783
|
+
inference.inferredType = inferredType;
|
|
73891
73784
|
}
|
|
73892
73785
|
clearActiveMapperCaches();
|
|
73893
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-
|
|
5
|
+
"version": "6.0.0-pr-58910-25",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|