@typescript-deploys/pr-build 6.0.0-pr-62789-2 → 6.0.0-pr-53017-20
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 +70 -6
- package/lib/lib.es5.d.ts +9 -0
- package/lib/typescript.js +70 -6
- 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.20251129`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -68153,7 +68153,8 @@ function createTypeChecker(host) {
|
|
|
68153
68153
|
priority: void 0,
|
|
68154
68154
|
topLevel: true,
|
|
68155
68155
|
isFixed: false,
|
|
68156
|
-
impliedArity: void 0
|
|
68156
|
+
impliedArity: void 0,
|
|
68157
|
+
indexes: void 0
|
|
68157
68158
|
};
|
|
68158
68159
|
}
|
|
68159
68160
|
function cloneInferenceInfo(inference) {
|
|
@@ -68165,7 +68166,8 @@ function createTypeChecker(host) {
|
|
|
68165
68166
|
priority: inference.priority,
|
|
68166
68167
|
topLevel: inference.topLevel,
|
|
68167
68168
|
isFixed: inference.isFixed,
|
|
68168
|
-
impliedArity: inference.impliedArity
|
|
68169
|
+
impliedArity: inference.impliedArity,
|
|
68170
|
+
indexes: inference.indexes && inference.indexes.slice()
|
|
68169
68171
|
};
|
|
68170
68172
|
}
|
|
68171
68173
|
function cloneInferredPartOfContext(context) {
|
|
@@ -68283,7 +68285,7 @@ function createTypeChecker(host) {
|
|
|
68283
68285
|
const templateType = getTemplateTypeFromMappedType(target);
|
|
68284
68286
|
const inference = createInferenceInfo(typeParameter);
|
|
68285
68287
|
inferTypes([inference], sourceType, templateType);
|
|
68286
|
-
return getTypeFromInference(inference) || unknownType;
|
|
68288
|
+
return getTypeFromInference(inference) || (inference.indexes ? getIntersectionType(inference.indexes) : unknownType);
|
|
68287
68289
|
}
|
|
68288
68290
|
function inferReverseMappedType(source, target, constraint) {
|
|
68289
68291
|
const cacheKey = source.id + "," + target.id + "," + constraint.id;
|
|
@@ -68624,6 +68626,24 @@ function createTypeChecker(host) {
|
|
|
68624
68626
|
} else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
|
|
68625
68627
|
inferFromTypes(source.objectType, target.objectType);
|
|
68626
68628
|
inferFromTypes(source.indexType, target.indexType);
|
|
68629
|
+
} else if (!(priority & 1 /* NakedTypeVariable */) && target.flags & 8388608 /* IndexedAccess */) {
|
|
68630
|
+
if (isFromInferenceBlockedSource(source)) {
|
|
68631
|
+
return;
|
|
68632
|
+
}
|
|
68633
|
+
const inference = getInferenceInfoForType(getActualTypeVariable(target.objectType));
|
|
68634
|
+
if (inference) {
|
|
68635
|
+
if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
68636
|
+
return;
|
|
68637
|
+
}
|
|
68638
|
+
if (!inference.isFixed) {
|
|
68639
|
+
const inferenceTypeSymbol = getGlobalSymbol("PartialInference", 788968 /* Type */, Diagnostics.Cannot_find_global_type_0);
|
|
68640
|
+
const inferenceType = inferenceTypeSymbol && getDeclaredTypeOfSymbol(inferenceTypeSymbol);
|
|
68641
|
+
if (inferenceType && inferenceType !== unknownType) {
|
|
68642
|
+
const mapper = createTypeMapper(getSymbolLinks(inferenceTypeSymbol).typeParameters, [source, target.indexType]);
|
|
68643
|
+
inference.indexes = append(inference.indexes, instantiateType(inferenceType, mapper));
|
|
68644
|
+
}
|
|
68645
|
+
}
|
|
68646
|
+
}
|
|
68627
68647
|
} else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) {
|
|
68628
68648
|
if (source.symbol === target.symbol) {
|
|
68629
68649
|
inferFromTypes(source.type, target.type);
|
|
@@ -69127,6 +69147,51 @@ function createTypeChecker(host) {
|
|
|
69127
69147
|
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))));
|
|
69128
69148
|
inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
|
|
69129
69149
|
fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
|
|
69150
|
+
} else if (inference.indexes) {
|
|
69151
|
+
let aggregateInference = getIntersectionType(inference.indexes);
|
|
69152
|
+
const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
|
|
69153
|
+
if (constraint2) {
|
|
69154
|
+
const instantiatedConstraint = instantiateType(constraint2, context.nonFixingMapper);
|
|
69155
|
+
if (instantiatedConstraint.flags & 1048576 /* Union */ && !context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference))) {
|
|
69156
|
+
const discriminantProps = findDiscriminantProperties(getPropertiesOfType(aggregateInference), instantiatedConstraint);
|
|
69157
|
+
if (discriminantProps) {
|
|
69158
|
+
let match;
|
|
69159
|
+
findDiscriminant:
|
|
69160
|
+
for (const p of discriminantProps) {
|
|
69161
|
+
const candidatePropType = getTypeOfPropertyOfType(aggregateInference, p.escapedName);
|
|
69162
|
+
for (const type of instantiatedConstraint.types) {
|
|
69163
|
+
const propType = getTypeOfPropertyOfType(type, p.escapedName);
|
|
69164
|
+
if (propType && candidatePropType && checkTypeAssignableTo(
|
|
69165
|
+
candidatePropType,
|
|
69166
|
+
propType,
|
|
69167
|
+
/*errorNode*/
|
|
69168
|
+
void 0
|
|
69169
|
+
)) {
|
|
69170
|
+
if (match && match !== type) {
|
|
69171
|
+
match = void 0;
|
|
69172
|
+
break findDiscriminant;
|
|
69173
|
+
} else {
|
|
69174
|
+
match = type;
|
|
69175
|
+
}
|
|
69176
|
+
}
|
|
69177
|
+
}
|
|
69178
|
+
}
|
|
69179
|
+
if (match) {
|
|
69180
|
+
aggregateInference = getSpreadType(
|
|
69181
|
+
match,
|
|
69182
|
+
aggregateInference,
|
|
69183
|
+
/*symbol*/
|
|
69184
|
+
void 0,
|
|
69185
|
+
/*propegatedFlags*/
|
|
69186
|
+
0,
|
|
69187
|
+
/*readonly*/
|
|
69188
|
+
false
|
|
69189
|
+
);
|
|
69190
|
+
}
|
|
69191
|
+
}
|
|
69192
|
+
}
|
|
69193
|
+
}
|
|
69194
|
+
inferredType = aggregateInference;
|
|
69130
69195
|
} else if (context.flags & 1 /* NoDefault */) {
|
|
69131
69196
|
inferredType = silentNeverType;
|
|
69132
69197
|
} else {
|
|
@@ -79809,8 +79874,7 @@ function createTypeChecker(host) {
|
|
|
79809
79874
|
}
|
|
79810
79875
|
}
|
|
79811
79876
|
function isNotWithinNullishCoalesceExpression(node) {
|
|
79812
|
-
|
|
79813
|
-
return !isBinaryExpression(parent) || parent.operatorToken.kind !== 61 /* QuestionQuestionToken */;
|
|
79877
|
+
return !isBinaryExpression(node.parent) || node.parent.operatorToken.kind !== 61 /* QuestionQuestionToken */;
|
|
79814
79878
|
}
|
|
79815
79879
|
function getSyntacticNullishnessSemantics(node) {
|
|
79816
79880
|
node = skipOuterExpressions(node);
|
package/lib/lib.es5.d.ts
CHANGED
|
@@ -1682,6 +1682,15 @@ 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 string> = ({
|
|
1689
|
+
[K in Keys]: {
|
|
1690
|
+
[K1 in K]: T;
|
|
1691
|
+
};
|
|
1692
|
+
})[Keys];
|
|
1693
|
+
|
|
1685
1694
|
/**
|
|
1686
1695
|
* Stores types to be used with WeakSet, WeakMap, WeakRef, and FinalizationRegistry
|
|
1687
1696
|
*/
|
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.20251129`;
|
|
2290
2290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2291
2291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2292
2292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -72781,7 +72781,8 @@ function createTypeChecker(host) {
|
|
|
72781
72781
|
priority: void 0,
|
|
72782
72782
|
topLevel: true,
|
|
72783
72783
|
isFixed: false,
|
|
72784
|
-
impliedArity: void 0
|
|
72784
|
+
impliedArity: void 0,
|
|
72785
|
+
indexes: void 0
|
|
72785
72786
|
};
|
|
72786
72787
|
}
|
|
72787
72788
|
function cloneInferenceInfo(inference) {
|
|
@@ -72793,7 +72794,8 @@ function createTypeChecker(host) {
|
|
|
72793
72794
|
priority: inference.priority,
|
|
72794
72795
|
topLevel: inference.topLevel,
|
|
72795
72796
|
isFixed: inference.isFixed,
|
|
72796
|
-
impliedArity: inference.impliedArity
|
|
72797
|
+
impliedArity: inference.impliedArity,
|
|
72798
|
+
indexes: inference.indexes && inference.indexes.slice()
|
|
72797
72799
|
};
|
|
72798
72800
|
}
|
|
72799
72801
|
function cloneInferredPartOfContext(context) {
|
|
@@ -72911,7 +72913,7 @@ function createTypeChecker(host) {
|
|
|
72911
72913
|
const templateType = getTemplateTypeFromMappedType(target);
|
|
72912
72914
|
const inference = createInferenceInfo(typeParameter);
|
|
72913
72915
|
inferTypes([inference], sourceType, templateType);
|
|
72914
|
-
return getTypeFromInference(inference) || unknownType;
|
|
72916
|
+
return getTypeFromInference(inference) || (inference.indexes ? getIntersectionType(inference.indexes) : unknownType);
|
|
72915
72917
|
}
|
|
72916
72918
|
function inferReverseMappedType(source, target, constraint) {
|
|
72917
72919
|
const cacheKey = source.id + "," + target.id + "," + constraint.id;
|
|
@@ -73252,6 +73254,24 @@ function createTypeChecker(host) {
|
|
|
73252
73254
|
} else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
|
|
73253
73255
|
inferFromTypes(source.objectType, target.objectType);
|
|
73254
73256
|
inferFromTypes(source.indexType, target.indexType);
|
|
73257
|
+
} else if (!(priority & 1 /* NakedTypeVariable */) && target.flags & 8388608 /* IndexedAccess */) {
|
|
73258
|
+
if (isFromInferenceBlockedSource(source)) {
|
|
73259
|
+
return;
|
|
73260
|
+
}
|
|
73261
|
+
const inference = getInferenceInfoForType(getActualTypeVariable(target.objectType));
|
|
73262
|
+
if (inference) {
|
|
73263
|
+
if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
73264
|
+
return;
|
|
73265
|
+
}
|
|
73266
|
+
if (!inference.isFixed) {
|
|
73267
|
+
const inferenceTypeSymbol = getGlobalSymbol("PartialInference", 788968 /* Type */, Diagnostics.Cannot_find_global_type_0);
|
|
73268
|
+
const inferenceType = inferenceTypeSymbol && getDeclaredTypeOfSymbol(inferenceTypeSymbol);
|
|
73269
|
+
if (inferenceType && inferenceType !== unknownType) {
|
|
73270
|
+
const mapper = createTypeMapper(getSymbolLinks(inferenceTypeSymbol).typeParameters, [source, target.indexType]);
|
|
73271
|
+
inference.indexes = append(inference.indexes, instantiateType(inferenceType, mapper));
|
|
73272
|
+
}
|
|
73273
|
+
}
|
|
73274
|
+
}
|
|
73255
73275
|
} else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) {
|
|
73256
73276
|
if (source.symbol === target.symbol) {
|
|
73257
73277
|
inferFromTypes(source.type, target.type);
|
|
@@ -73755,6 +73775,51 @@ function createTypeChecker(host) {
|
|
|
73755
73775
|
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))));
|
|
73756
73776
|
inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
|
|
73757
73777
|
fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
|
|
73778
|
+
} else if (inference.indexes) {
|
|
73779
|
+
let aggregateInference = getIntersectionType(inference.indexes);
|
|
73780
|
+
const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
|
|
73781
|
+
if (constraint2) {
|
|
73782
|
+
const instantiatedConstraint = instantiateType(constraint2, context.nonFixingMapper);
|
|
73783
|
+
if (instantiatedConstraint.flags & 1048576 /* Union */ && !context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference))) {
|
|
73784
|
+
const discriminantProps = findDiscriminantProperties(getPropertiesOfType(aggregateInference), instantiatedConstraint);
|
|
73785
|
+
if (discriminantProps) {
|
|
73786
|
+
let match;
|
|
73787
|
+
findDiscriminant:
|
|
73788
|
+
for (const p of discriminantProps) {
|
|
73789
|
+
const candidatePropType = getTypeOfPropertyOfType(aggregateInference, p.escapedName);
|
|
73790
|
+
for (const type of instantiatedConstraint.types) {
|
|
73791
|
+
const propType = getTypeOfPropertyOfType(type, p.escapedName);
|
|
73792
|
+
if (propType && candidatePropType && checkTypeAssignableTo(
|
|
73793
|
+
candidatePropType,
|
|
73794
|
+
propType,
|
|
73795
|
+
/*errorNode*/
|
|
73796
|
+
void 0
|
|
73797
|
+
)) {
|
|
73798
|
+
if (match && match !== type) {
|
|
73799
|
+
match = void 0;
|
|
73800
|
+
break findDiscriminant;
|
|
73801
|
+
} else {
|
|
73802
|
+
match = type;
|
|
73803
|
+
}
|
|
73804
|
+
}
|
|
73805
|
+
}
|
|
73806
|
+
}
|
|
73807
|
+
if (match) {
|
|
73808
|
+
aggregateInference = getSpreadType(
|
|
73809
|
+
match,
|
|
73810
|
+
aggregateInference,
|
|
73811
|
+
/*symbol*/
|
|
73812
|
+
void 0,
|
|
73813
|
+
/*propegatedFlags*/
|
|
73814
|
+
0,
|
|
73815
|
+
/*readonly*/
|
|
73816
|
+
false
|
|
73817
|
+
);
|
|
73818
|
+
}
|
|
73819
|
+
}
|
|
73820
|
+
}
|
|
73821
|
+
}
|
|
73822
|
+
inferredType = aggregateInference;
|
|
73758
73823
|
} else if (context.flags & 1 /* NoDefault */) {
|
|
73759
73824
|
inferredType = silentNeverType;
|
|
73760
73825
|
} else {
|
|
@@ -84437,8 +84502,7 @@ function createTypeChecker(host) {
|
|
|
84437
84502
|
}
|
|
84438
84503
|
}
|
|
84439
84504
|
function isNotWithinNullishCoalesceExpression(node) {
|
|
84440
|
-
|
|
84441
|
-
return !isBinaryExpression(parent2) || parent2.operatorToken.kind !== 61 /* QuestionQuestionToken */;
|
|
84505
|
+
return !isBinaryExpression(node.parent) || node.parent.operatorToken.kind !== 61 /* QuestionQuestionToken */;
|
|
84442
84506
|
}
|
|
84443
84507
|
function getSyntacticNullishnessSemantics(node) {
|
|
84444
84508
|
node = skipOuterExpressions(node);
|
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-53017-20",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|