@typescript-deploys/pr-build 6.0.0-pr-62243-18 → 6.0.0-pr-62093-9
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 +57 -63
- package/lib/typescript.d.ts +5 -4
- package/lib/typescript.js +67 -72
- package/package.json +19 -20
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.20250814`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -4254,10 +4254,10 @@ function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, cal
|
|
|
4254
4254
|
cache.set(path, {
|
|
4255
4255
|
watcher: createWatcher(
|
|
4256
4256
|
// Cant infer types correctly so lets satisfy checker
|
|
4257
|
-
(param1, param2, param3) => {
|
|
4257
|
+
((param1, param2, param3) => {
|
|
4258
4258
|
var _a;
|
|
4259
4259
|
return (_a = cache.get(path)) == null ? void 0 : _a.callbacks.slice().forEach((cb) => cb(param1, param2, param3));
|
|
4260
|
-
}
|
|
4260
|
+
})
|
|
4261
4261
|
),
|
|
4262
4262
|
callbacks: [callback]
|
|
4263
4263
|
});
|
|
@@ -14265,15 +14265,12 @@ function forEachYieldExpression(body, visitor) {
|
|
|
14265
14265
|
function traverse(node) {
|
|
14266
14266
|
switch (node.kind) {
|
|
14267
14267
|
case 230 /* YieldExpression */:
|
|
14268
|
-
|
|
14269
|
-
if (value) {
|
|
14270
|
-
return value;
|
|
14271
|
-
}
|
|
14268
|
+
visitor(node);
|
|
14272
14269
|
const operand = node.expression;
|
|
14273
|
-
if (
|
|
14274
|
-
|
|
14270
|
+
if (operand) {
|
|
14271
|
+
traverse(operand);
|
|
14275
14272
|
}
|
|
14276
|
-
return
|
|
14273
|
+
return;
|
|
14277
14274
|
case 267 /* EnumDeclaration */:
|
|
14278
14275
|
case 265 /* InterfaceDeclaration */:
|
|
14279
14276
|
case 268 /* ModuleDeclaration */:
|
|
@@ -14282,10 +14279,11 @@ function forEachYieldExpression(body, visitor) {
|
|
|
14282
14279
|
default:
|
|
14283
14280
|
if (isFunctionLike(node)) {
|
|
14284
14281
|
if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
|
|
14285
|
-
|
|
14282
|
+
traverse(node.name.expression);
|
|
14283
|
+
return;
|
|
14286
14284
|
}
|
|
14287
14285
|
} else if (!isPartOfTypeNode(node)) {
|
|
14288
|
-
|
|
14286
|
+
forEachChild(node, traverse);
|
|
14289
14287
|
}
|
|
14290
14288
|
}
|
|
14291
14289
|
}
|
|
@@ -19135,7 +19133,7 @@ function hasContextSensitiveParameters(node) {
|
|
|
19135
19133
|
if (node.kind !== 220 /* ArrowFunction */) {
|
|
19136
19134
|
const parameter = firstOrUndefined(node.parameters);
|
|
19137
19135
|
if (!(parameter && parameterIsThisKeyword(parameter))) {
|
|
19138
|
-
return
|
|
19136
|
+
return true;
|
|
19139
19137
|
}
|
|
19140
19138
|
}
|
|
19141
19139
|
}
|
|
@@ -42649,7 +42647,6 @@ function createBinder() {
|
|
|
42649
42647
|
const saveExceptionTarget = currentExceptionTarget;
|
|
42650
42648
|
const saveActiveLabelList = activeLabelList;
|
|
42651
42649
|
const saveHasExplicitReturn = hasExplicitReturn;
|
|
42652
|
-
const saveSeenThisKeyword = seenThisKeyword;
|
|
42653
42650
|
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
|
|
42654
42651
|
if (!isImmediatelyInvoked) {
|
|
42655
42652
|
currentFlow = createFlowNode(
|
|
@@ -42669,17 +42666,13 @@ function createBinder() {
|
|
|
42669
42666
|
currentContinueTarget = void 0;
|
|
42670
42667
|
activeLabelList = void 0;
|
|
42671
42668
|
hasExplicitReturn = false;
|
|
42672
|
-
seenThisKeyword = false;
|
|
42673
42669
|
bindChildren(node);
|
|
42674
|
-
node.flags &= ~
|
|
42670
|
+
node.flags &= ~5632 /* ReachabilityAndEmitFlags */;
|
|
42675
42671
|
if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
|
|
42676
42672
|
node.flags |= 512 /* HasImplicitReturn */;
|
|
42677
42673
|
if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
|
|
42678
42674
|
node.endFlowNode = currentFlow;
|
|
42679
42675
|
}
|
|
42680
|
-
if (seenThisKeyword) {
|
|
42681
|
-
node.flags |= 256 /* ContainsThis */;
|
|
42682
|
-
}
|
|
42683
42676
|
if (node.kind === 308 /* SourceFile */) {
|
|
42684
42677
|
node.flags |= emitFlags;
|
|
42685
42678
|
node.endFlowNode = currentFlow;
|
|
@@ -42700,14 +42693,11 @@ function createBinder() {
|
|
|
42700
42693
|
currentExceptionTarget = saveExceptionTarget;
|
|
42701
42694
|
activeLabelList = saveActiveLabelList;
|
|
42702
42695
|
hasExplicitReturn = saveHasExplicitReturn;
|
|
42703
|
-
seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
|
|
42704
42696
|
} else if (containerFlags & 64 /* IsInterface */) {
|
|
42705
|
-
const saveSeenThisKeyword = seenThisKeyword;
|
|
42706
42697
|
seenThisKeyword = false;
|
|
42707
42698
|
bindChildren(node);
|
|
42708
42699
|
Debug.assertNotNode(node, isIdentifier);
|
|
42709
42700
|
node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
|
|
42710
|
-
seenThisKeyword = saveSeenThisKeyword;
|
|
42711
42701
|
} else {
|
|
42712
42702
|
bindChildren(node);
|
|
42713
42703
|
}
|
|
@@ -44195,9 +44185,6 @@ function createBinder() {
|
|
|
44195
44185
|
}
|
|
44196
44186
|
// falls through
|
|
44197
44187
|
case 110 /* ThisKeyword */:
|
|
44198
|
-
if (node.kind === 110 /* ThisKeyword */) {
|
|
44199
|
-
seenThisKeyword = true;
|
|
44200
|
-
}
|
|
44201
44188
|
if (currentFlow && (isExpression(node) || parent.kind === 305 /* ShorthandPropertyAssignment */)) {
|
|
44202
44189
|
node.flowNode = currentFlow;
|
|
44203
44190
|
}
|
|
@@ -45120,8 +45107,6 @@ function getContainerFlags(node) {
|
|
|
45120
45107
|
// falls through
|
|
45121
45108
|
case 177 /* Constructor */:
|
|
45122
45109
|
case 263 /* FunctionDeclaration */:
|
|
45123
|
-
case 176 /* ClassStaticBlockDeclaration */:
|
|
45124
|
-
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
45125
45110
|
case 174 /* MethodSignature */:
|
|
45126
45111
|
case 180 /* CallSignature */:
|
|
45127
45112
|
case 324 /* JSDocSignature */:
|
|
@@ -45129,14 +45114,17 @@ function getContainerFlags(node) {
|
|
|
45129
45114
|
case 185 /* FunctionType */:
|
|
45130
45115
|
case 181 /* ConstructSignature */:
|
|
45131
45116
|
case 186 /* ConstructorType */:
|
|
45132
|
-
|
|
45117
|
+
case 176 /* ClassStaticBlockDeclaration */:
|
|
45118
|
+
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
45133
45119
|
case 352 /* JSDocImportTag */:
|
|
45134
|
-
return 1 /* IsContainer */ | 32 /* HasLocals */;
|
|
45120
|
+
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
|
|
45135
45121
|
case 219 /* FunctionExpression */:
|
|
45136
45122
|
case 220 /* ArrowFunction */:
|
|
45137
45123
|
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
|
|
45138
45124
|
case 269 /* ModuleBlock */:
|
|
45139
45125
|
return 4 /* IsControlFlowContainer */;
|
|
45126
|
+
case 173 /* PropertyDeclaration */:
|
|
45127
|
+
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
|
|
45140
45128
|
case 300 /* CatchClause */:
|
|
45141
45129
|
case 249 /* ForStatement */:
|
|
45142
45130
|
case 250 /* ForInStatement */:
|
|
@@ -62571,7 +62559,7 @@ function createTypeChecker(host) {
|
|
|
62571
62559
|
context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper);
|
|
62572
62560
|
}
|
|
62573
62561
|
if (!checkTypeDeferred) {
|
|
62574
|
-
inferTypes(context.inferences, checkType, extendsType,
|
|
62562
|
+
inferTypes(context.inferences, checkType, extendsType, 1024 /* NoConstraints */ | 2048 /* AlwaysStrict */);
|
|
62575
62563
|
}
|
|
62576
62564
|
combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
|
|
62577
62565
|
}
|
|
@@ -63750,8 +63738,7 @@ function createTypeChecker(host) {
|
|
|
63750
63738
|
const { initializer } = node;
|
|
63751
63739
|
return !!initializer && isContextSensitive(initializer);
|
|
63752
63740
|
}
|
|
63753
|
-
case 295 /* JsxExpression */:
|
|
63754
|
-
case 230 /* YieldExpression */: {
|
|
63741
|
+
case 295 /* JsxExpression */: {
|
|
63755
63742
|
const { expression } = node;
|
|
63756
63743
|
return !!expression && isContextSensitive(expression);
|
|
63757
63744
|
}
|
|
@@ -63759,7 +63746,7 @@ function createTypeChecker(host) {
|
|
|
63759
63746
|
return false;
|
|
63760
63747
|
}
|
|
63761
63748
|
function isContextSensitiveFunctionLikeDeclaration(node) {
|
|
63762
|
-
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node)
|
|
63749
|
+
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
|
|
63763
63750
|
}
|
|
63764
63751
|
function hasContextSensitiveReturnExpression(node) {
|
|
63765
63752
|
if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
|
|
@@ -64250,9 +64237,9 @@ function createTypeChecker(host) {
|
|
|
64250
64237
|
const elem = getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic);
|
|
64251
64238
|
if (elem) {
|
|
64252
64239
|
result = elaborateElementwise(
|
|
64253
|
-
function* () {
|
|
64240
|
+
(function* () {
|
|
64254
64241
|
yield elem;
|
|
64255
|
-
}(),
|
|
64242
|
+
})(),
|
|
64256
64243
|
source,
|
|
64257
64244
|
target,
|
|
64258
64245
|
relation,
|
|
@@ -66259,7 +66246,7 @@ function createTypeChecker(host) {
|
|
|
66259
66246
|
0 /* None */,
|
|
66260
66247
|
isRelatedToWorker
|
|
66261
66248
|
);
|
|
66262
|
-
inferTypes(ctx.inferences, target2.extendsType, sourceExtends,
|
|
66249
|
+
inferTypes(ctx.inferences, target2.extendsType, sourceExtends, 1024 /* NoConstraints */ | 2048 /* AlwaysStrict */);
|
|
66263
66250
|
sourceExtends = instantiateType(sourceExtends, ctx.mapper);
|
|
66264
66251
|
mapper = ctx.mapper;
|
|
66265
66252
|
}
|
|
@@ -68524,7 +68511,7 @@ function createTypeChecker(host) {
|
|
|
68524
68511
|
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
68525
68512
|
let bivariant = false;
|
|
68526
68513
|
let propagationType;
|
|
68527
|
-
let inferencePriority =
|
|
68514
|
+
let inferencePriority = 4096 /* MaxValue */;
|
|
68528
68515
|
let visited;
|
|
68529
68516
|
let sourceStack;
|
|
68530
68517
|
let targetStack;
|
|
@@ -68599,13 +68586,18 @@ function createTypeChecker(host) {
|
|
|
68599
68586
|
if (candidate === blockedStringType) {
|
|
68600
68587
|
return;
|
|
68601
68588
|
}
|
|
68602
|
-
|
|
68589
|
+
const combinedPriority = priority | (inference.individualPriority || 0 /* None */);
|
|
68590
|
+
if (inference.priority === void 0 || priority < (inference.priority & ~512 /* DistributiveConditional */)) {
|
|
68603
68591
|
inference.candidates = void 0;
|
|
68604
68592
|
inference.contraCandidates = void 0;
|
|
68605
68593
|
inference.topLevel = true;
|
|
68606
|
-
inference.priority =
|
|
68594
|
+
inference.priority = combinedPriority;
|
|
68607
68595
|
}
|
|
68608
|
-
if (priority === inference.priority) {
|
|
68596
|
+
if (priority === (inference.priority & ~512 /* DistributiveConditional */)) {
|
|
68597
|
+
if (inference.priority !== combinedPriority) {
|
|
68598
|
+
inference.priority = combinedPriority;
|
|
68599
|
+
clearCachedInferences(inferences);
|
|
68600
|
+
}
|
|
68609
68601
|
if (contravariant && !bivariant) {
|
|
68610
68602
|
if (!contains(inference.contraCandidates, candidate)) {
|
|
68611
68603
|
inference.contraCandidates = append(inference.contraCandidates, candidate);
|
|
@@ -68687,7 +68679,7 @@ function createTypeChecker(host) {
|
|
|
68687
68679
|
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
68688
68680
|
invokeOnce(source, target, inferFromGenericMappedTypes);
|
|
68689
68681
|
}
|
|
68690
|
-
if (!(priority &
|
|
68682
|
+
if (!(priority & 1024 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
68691
68683
|
const apparentSource = getApparentType(source);
|
|
68692
68684
|
if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
|
|
68693
68685
|
return inferFromTypes(apparentSource, target);
|
|
@@ -68726,7 +68718,7 @@ function createTypeChecker(host) {
|
|
|
68726
68718
|
}
|
|
68727
68719
|
(visited || (visited = /* @__PURE__ */ new Map())).set(key, -1 /* Circularity */);
|
|
68728
68720
|
const saveInferencePriority = inferencePriority;
|
|
68729
|
-
inferencePriority =
|
|
68721
|
+
inferencePriority = 4096 /* MaxValue */;
|
|
68730
68722
|
const saveExpandingFlags = expandingFlags;
|
|
68731
68723
|
(sourceStack ?? (sourceStack = [])).push(source);
|
|
68732
68724
|
(targetStack ?? (targetStack = [])).push(target);
|
|
@@ -68776,7 +68768,7 @@ function createTypeChecker(host) {
|
|
|
68776
68768
|
contravariant = !contravariant;
|
|
68777
68769
|
}
|
|
68778
68770
|
function inferFromContravariantTypesIfStrictFunctionTypes(source, target) {
|
|
68779
|
-
if (strictFunctionTypes || priority &
|
|
68771
|
+
if (strictFunctionTypes || priority & 2048 /* AlwaysStrict */) {
|
|
68780
68772
|
inferFromContravariantTypes(source, target);
|
|
68781
68773
|
} else {
|
|
68782
68774
|
inferFromTypes(source, target);
|
|
@@ -68817,7 +68809,7 @@ function createTypeChecker(host) {
|
|
|
68817
68809
|
} else {
|
|
68818
68810
|
for (let i = 0; i < sources.length; i++) {
|
|
68819
68811
|
const saveInferencePriority = inferencePriority;
|
|
68820
|
-
inferencePriority =
|
|
68812
|
+
inferencePriority = 4096 /* MaxValue */;
|
|
68821
68813
|
inferFromTypes(sources[i], t);
|
|
68822
68814
|
if (inferencePriority === priority) matched[i] = true;
|
|
68823
68815
|
inferenceCircularity = inferenceCircularity || inferencePriority === -1 /* Circularity */;
|
|
@@ -68896,6 +68888,11 @@ function createTypeChecker(host) {
|
|
|
68896
68888
|
return false;
|
|
68897
68889
|
}
|
|
68898
68890
|
function inferToConditionalType(source, target) {
|
|
68891
|
+
const info = target.root.isDistributive ? getInferenceInfoForType(getActualTypeVariable(target.checkType)) : void 0;
|
|
68892
|
+
const saveIndividualPriority = info == null ? void 0 : info.individualPriority;
|
|
68893
|
+
if (info) {
|
|
68894
|
+
info.individualPriority = (info.individualPriority || 0 /* None */) | 512 /* DistributiveConditional */;
|
|
68895
|
+
}
|
|
68899
68896
|
if (source.flags & 16777216 /* Conditional */) {
|
|
68900
68897
|
inferFromTypes(source.checkType, target.checkType);
|
|
68901
68898
|
inferFromTypes(source.extendsType, target.extendsType);
|
|
@@ -68905,6 +68902,9 @@ function createTypeChecker(host) {
|
|
|
68905
68902
|
const targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)];
|
|
68906
68903
|
inferToMultipleTypesWithPriority(source, targetTypes, target.flags, contravariant ? 64 /* ContravariantConditional */ : 0);
|
|
68907
68904
|
}
|
|
68905
|
+
if (info) {
|
|
68906
|
+
info.individualPriority = saveIndividualPriority;
|
|
68907
|
+
}
|
|
68908
68908
|
}
|
|
68909
68909
|
function inferToTemplateLiteralType(source, target) {
|
|
68910
68910
|
const matches = inferTypesFromTemplateLiteralType(source, target);
|
|
@@ -69145,14 +69145,14 @@ function createTypeChecker(host) {
|
|
|
69145
69145
|
return candidates;
|
|
69146
69146
|
}
|
|
69147
69147
|
function getContravariantInference(inference) {
|
|
69148
|
-
return inference.priority &
|
|
69148
|
+
return inference.priority & 928 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
|
|
69149
69149
|
}
|
|
69150
69150
|
function getCovariantInference(inference, signature) {
|
|
69151
69151
|
const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
|
|
69152
69152
|
const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter);
|
|
69153
69153
|
const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter));
|
|
69154
69154
|
const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates;
|
|
69155
|
-
const unwidenedType = inference.priority &
|
|
69155
|
+
const unwidenedType = inference.priority & 928 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
|
|
69156
69156
|
return getWidenedType(unwidenedType);
|
|
69157
69157
|
}
|
|
69158
69158
|
function getInferredType(context, index) {
|
|
@@ -73259,7 +73259,7 @@ function createTypeChecker(host) {
|
|
|
73259
73259
|
concatenate(
|
|
73260
73260
|
map(
|
|
73261
73261
|
filter(node.properties, (p) => !!p.symbol && p.kind === 292 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
|
|
73262
|
-
(prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
|
|
73262
|
+
(prop) => [!prop.initializer ? (() => trueType) : (() => getContextFreeTypeOfExpression(prop.initializer)), prop.symbol.escapedName]
|
|
73263
73263
|
),
|
|
73264
73264
|
map(
|
|
73265
73265
|
filter(getPropertiesOfType(contextualType), (s) => {
|
|
@@ -73301,10 +73301,7 @@ function createTypeChecker(host) {
|
|
|
73301
73301
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
|
|
73302
73302
|
const inferenceContext = getInferenceContext(node);
|
|
73303
73303
|
if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
73304
|
-
|
|
73305
|
-
if (!(type.flags & 3 /* AnyOrUnknown */)) {
|
|
73306
|
-
return type;
|
|
73307
|
-
}
|
|
73304
|
+
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
73308
73305
|
}
|
|
73309
73306
|
if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
|
|
73310
73307
|
const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
|
|
@@ -75920,11 +75917,11 @@ function createTypeChecker(host) {
|
|
|
75920
75917
|
Debug.assert(typeParameters[i] !== void 0, "Should not call checkTypeArguments with too many type arguments");
|
|
75921
75918
|
const constraint = getConstraintOfTypeParameter(typeParameters[i]);
|
|
75922
75919
|
if (constraint) {
|
|
75923
|
-
const errorInfo = reportErrors2 && headMessage ? () => chainDiagnosticMessages(
|
|
75920
|
+
const errorInfo = reportErrors2 && headMessage ? (() => chainDiagnosticMessages(
|
|
75924
75921
|
/*details*/
|
|
75925
75922
|
void 0,
|
|
75926
75923
|
Diagnostics.Type_0_does_not_satisfy_the_constraint_1
|
|
75927
|
-
) : void 0;
|
|
75924
|
+
)) : void 0;
|
|
75928
75925
|
const typeArgumentHeadMessage = headMessage || Diagnostics.Type_0_does_not_satisfy_the_constraint_1;
|
|
75929
75926
|
if (!mapper) {
|
|
75930
75927
|
mapper = createTypeMapper(typeParameters, typeArgumentTypes);
|
|
@@ -76907,12 +76904,9 @@ function createTypeChecker(host) {
|
|
|
76907
76904
|
}
|
|
76908
76905
|
return resolveErrorCall(node);
|
|
76909
76906
|
}
|
|
76910
|
-
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments) {
|
|
76911
|
-
|
|
76912
|
-
|
|
76913
|
-
skippedGenericFunction(node, checkMode);
|
|
76914
|
-
return resolvingSignature;
|
|
76915
|
-
}
|
|
76907
|
+
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
|
|
76908
|
+
skippedGenericFunction(node, checkMode);
|
|
76909
|
+
return resolvingSignature;
|
|
76916
76910
|
}
|
|
76917
76911
|
if (callSignatures.some((sig) => isInJSFile(sig.declaration) && !!getJSDocClassTag(sig.declaration))) {
|
|
76918
76912
|
error(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
|
|
@@ -90356,7 +90350,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
|
|
|
90356
90350
|
isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
|
|
90357
90351
|
fileExists: (fileName) => host.fileExists(fileName),
|
|
90358
90352
|
getFileIncludeReasons: () => host.getFileIncludeReasons(),
|
|
90359
|
-
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0,
|
|
90353
|
+
readFile: host.readFile ? ((fileName) => host.readFile(fileName)) : void 0,
|
|
90360
90354
|
getDefaultResolutionModeForFile: (file) => host.getDefaultResolutionModeForFile(file),
|
|
90361
90355
|
getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index),
|
|
90362
90356
|
getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
|
|
@@ -99062,7 +99056,7 @@ function transformESDecorators(context) {
|
|
|
99062
99056
|
} else {
|
|
99063
99057
|
Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name.");
|
|
99064
99058
|
const iife = transformClassLike(node);
|
|
99065
|
-
const modifierVisitorNoExport = isExport ? (node2) => isExportModifier(node2) ? void 0 : modifierVisitor(node2) : modifierVisitor;
|
|
99059
|
+
const modifierVisitorNoExport = isExport ? ((node2) => isExportModifier(node2) ? void 0 : modifierVisitor(node2)) : modifierVisitor;
|
|
99066
99060
|
const modifiers = visitNodes2(node.modifiers, modifierVisitorNoExport, isModifier);
|
|
99067
99061
|
const declName = factory2.getLocalName(
|
|
99068
99062
|
node,
|
|
@@ -128885,7 +128879,7 @@ var WatchType = {
|
|
|
128885
128879
|
};
|
|
128886
128880
|
function createWatchFactory(host, options) {
|
|
128887
128881
|
const watchLogLevel = host.trace ? options.extendedDiagnostics ? 2 /* Verbose */ : options.diagnostics ? 1 /* TriggerOnly */ : 0 /* None */ : 0 /* None */;
|
|
128888
|
-
const writeLog = watchLogLevel !== 0 /* None */ ? (s) => host.trace(s) : noop;
|
|
128882
|
+
const writeLog = watchLogLevel !== 0 /* None */ ? ((s) => host.trace(s)) : noop;
|
|
128889
128883
|
const result = getWatchFactory(host, watchLogLevel, writeLog);
|
|
128890
128884
|
result.writeLog = writeLog;
|
|
128891
128885
|
return result;
|
|
@@ -129194,7 +129188,7 @@ function createWatchProgram(host) {
|
|
|
129194
129188
|
compilerHost.resolveTypeReferenceDirectiveReferences = resolutionCache.resolveTypeReferenceDirectiveReferences.bind(resolutionCache);
|
|
129195
129189
|
}
|
|
129196
129190
|
compilerHost.resolveLibrary = !host.resolveLibrary ? resolutionCache.resolveLibrary.bind(resolutionCache) : host.resolveLibrary.bind(host);
|
|
129197
|
-
compilerHost.getModuleResolutionCache = host.resolveModuleNameLiterals || host.resolveModuleNames ? maybeBind(host, host.getModuleResolutionCache) : () => resolutionCache.getModuleResolutionCache();
|
|
129191
|
+
compilerHost.getModuleResolutionCache = host.resolveModuleNameLiterals || host.resolveModuleNames ? maybeBind(host, host.getModuleResolutionCache) : (() => resolutionCache.getModuleResolutionCache());
|
|
129198
129192
|
const userProvidedResolution = !!host.resolveModuleNameLiterals || !!host.resolveTypeReferenceDirectiveReferences || !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
129199
129193
|
const customHasInvalidatedResolutions = userProvidedResolution ? maybeBind(host, host.hasInvalidatedResolutions) || returnTrue : returnFalse;
|
|
129200
129194
|
const customHasInvalidLibResolutions = host.resolveLibrary ? maybeBind(host, host.hasInvalidatedLibResolutions) || returnTrue : returnFalse;
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6893,10 +6893,11 @@ declare namespace ts {
|
|
|
6893
6893
|
ContravariantConditional = 64,
|
|
6894
6894
|
ReturnType = 128,
|
|
6895
6895
|
LiteralKeyof = 256,
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6896
|
+
DistributiveConditional = 512,
|
|
6897
|
+
NoConstraints = 1024,
|
|
6898
|
+
AlwaysStrict = 2048,
|
|
6899
|
+
MaxValue = 4096,
|
|
6900
|
+
PriorityImpliesCombination = 928,
|
|
6900
6901
|
Circularity = -1,
|
|
6901
6902
|
}
|
|
6902
6903
|
interface FileExtensionInfo {
|
package/lib/typescript.js
CHANGED
|
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2285
2285
|
|
|
2286
2286
|
// src/compiler/corePublic.ts
|
|
2287
2287
|
var versionMajorMinor = "6.0";
|
|
2288
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2288
|
+
var version = `${versionMajorMinor}.0-insiders.20250814`;
|
|
2289
2289
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2290
2290
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2291
2291
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6641,10 +6641,11 @@ var InferencePriority = /* @__PURE__ */ ((InferencePriority2) => {
|
|
|
6641
6641
|
InferencePriority2[InferencePriority2["ContravariantConditional"] = 64] = "ContravariantConditional";
|
|
6642
6642
|
InferencePriority2[InferencePriority2["ReturnType"] = 128] = "ReturnType";
|
|
6643
6643
|
InferencePriority2[InferencePriority2["LiteralKeyof"] = 256] = "LiteralKeyof";
|
|
6644
|
-
InferencePriority2[InferencePriority2["
|
|
6645
|
-
InferencePriority2[InferencePriority2["
|
|
6646
|
-
InferencePriority2[InferencePriority2["
|
|
6647
|
-
InferencePriority2[InferencePriority2["
|
|
6644
|
+
InferencePriority2[InferencePriority2["DistributiveConditional"] = 512] = "DistributiveConditional";
|
|
6645
|
+
InferencePriority2[InferencePriority2["NoConstraints"] = 1024] = "NoConstraints";
|
|
6646
|
+
InferencePriority2[InferencePriority2["AlwaysStrict"] = 2048] = "AlwaysStrict";
|
|
6647
|
+
InferencePriority2[InferencePriority2["MaxValue"] = 4096] = "MaxValue";
|
|
6648
|
+
InferencePriority2[InferencePriority2["PriorityImpliesCombination"] = 928] = "PriorityImpliesCombination";
|
|
6648
6649
|
InferencePriority2[InferencePriority2["Circularity"] = -1] = "Circularity";
|
|
6649
6650
|
return InferencePriority2;
|
|
6650
6651
|
})(InferencePriority || {});
|
|
@@ -7623,10 +7624,10 @@ function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, cal
|
|
|
7623
7624
|
cache.set(path, {
|
|
7624
7625
|
watcher: createWatcher(
|
|
7625
7626
|
// Cant infer types correctly so lets satisfy checker
|
|
7626
|
-
(param1, param2, param3) => {
|
|
7627
|
+
((param1, param2, param3) => {
|
|
7627
7628
|
var _a;
|
|
7628
7629
|
return (_a = cache.get(path)) == null ? void 0 : _a.callbacks.slice().forEach((cb) => cb(param1, param2, param3));
|
|
7629
|
-
}
|
|
7630
|
+
})
|
|
7630
7631
|
),
|
|
7631
7632
|
callbacks: [callback]
|
|
7632
7633
|
});
|
|
@@ -17952,15 +17953,12 @@ function forEachYieldExpression(body, visitor) {
|
|
|
17952
17953
|
function traverse(node) {
|
|
17953
17954
|
switch (node.kind) {
|
|
17954
17955
|
case 230 /* YieldExpression */:
|
|
17955
|
-
|
|
17956
|
-
if (value) {
|
|
17957
|
-
return value;
|
|
17958
|
-
}
|
|
17956
|
+
visitor(node);
|
|
17959
17957
|
const operand = node.expression;
|
|
17960
|
-
if (
|
|
17961
|
-
|
|
17958
|
+
if (operand) {
|
|
17959
|
+
traverse(operand);
|
|
17962
17960
|
}
|
|
17963
|
-
return
|
|
17961
|
+
return;
|
|
17964
17962
|
case 267 /* EnumDeclaration */:
|
|
17965
17963
|
case 265 /* InterfaceDeclaration */:
|
|
17966
17964
|
case 268 /* ModuleDeclaration */:
|
|
@@ -17969,10 +17967,11 @@ function forEachYieldExpression(body, visitor) {
|
|
|
17969
17967
|
default:
|
|
17970
17968
|
if (isFunctionLike(node)) {
|
|
17971
17969
|
if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
|
|
17972
|
-
|
|
17970
|
+
traverse(node.name.expression);
|
|
17971
|
+
return;
|
|
17973
17972
|
}
|
|
17974
17973
|
} else if (!isPartOfTypeNode(node)) {
|
|
17975
|
-
|
|
17974
|
+
forEachChild(node, traverse);
|
|
17976
17975
|
}
|
|
17977
17976
|
}
|
|
17978
17977
|
}
|
|
@@ -23123,7 +23122,7 @@ function hasContextSensitiveParameters(node) {
|
|
|
23123
23122
|
if (node.kind !== 220 /* ArrowFunction */) {
|
|
23124
23123
|
const parameter = firstOrUndefined(node.parameters);
|
|
23125
23124
|
if (!(parameter && parameterIsThisKeyword(parameter))) {
|
|
23126
|
-
return
|
|
23125
|
+
return true;
|
|
23127
23126
|
}
|
|
23128
23127
|
}
|
|
23129
23128
|
}
|
|
@@ -47157,7 +47156,6 @@ function createBinder() {
|
|
|
47157
47156
|
const saveExceptionTarget = currentExceptionTarget;
|
|
47158
47157
|
const saveActiveLabelList = activeLabelList;
|
|
47159
47158
|
const saveHasExplicitReturn = hasExplicitReturn;
|
|
47160
|
-
const saveSeenThisKeyword = seenThisKeyword;
|
|
47161
47159
|
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
|
|
47162
47160
|
if (!isImmediatelyInvoked) {
|
|
47163
47161
|
currentFlow = createFlowNode(
|
|
@@ -47177,17 +47175,13 @@ function createBinder() {
|
|
|
47177
47175
|
currentContinueTarget = void 0;
|
|
47178
47176
|
activeLabelList = void 0;
|
|
47179
47177
|
hasExplicitReturn = false;
|
|
47180
|
-
seenThisKeyword = false;
|
|
47181
47178
|
bindChildren(node);
|
|
47182
|
-
node.flags &= ~
|
|
47179
|
+
node.flags &= ~5632 /* ReachabilityAndEmitFlags */;
|
|
47183
47180
|
if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
|
|
47184
47181
|
node.flags |= 512 /* HasImplicitReturn */;
|
|
47185
47182
|
if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
|
|
47186
47183
|
node.endFlowNode = currentFlow;
|
|
47187
47184
|
}
|
|
47188
|
-
if (seenThisKeyword) {
|
|
47189
|
-
node.flags |= 256 /* ContainsThis */;
|
|
47190
|
-
}
|
|
47191
47185
|
if (node.kind === 308 /* SourceFile */) {
|
|
47192
47186
|
node.flags |= emitFlags;
|
|
47193
47187
|
node.endFlowNode = currentFlow;
|
|
@@ -47208,14 +47202,11 @@ function createBinder() {
|
|
|
47208
47202
|
currentExceptionTarget = saveExceptionTarget;
|
|
47209
47203
|
activeLabelList = saveActiveLabelList;
|
|
47210
47204
|
hasExplicitReturn = saveHasExplicitReturn;
|
|
47211
|
-
seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
|
|
47212
47205
|
} else if (containerFlags & 64 /* IsInterface */) {
|
|
47213
|
-
const saveSeenThisKeyword = seenThisKeyword;
|
|
47214
47206
|
seenThisKeyword = false;
|
|
47215
47207
|
bindChildren(node);
|
|
47216
47208
|
Debug.assertNotNode(node, isIdentifier);
|
|
47217
47209
|
node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
|
|
47218
|
-
seenThisKeyword = saveSeenThisKeyword;
|
|
47219
47210
|
} else {
|
|
47220
47211
|
bindChildren(node);
|
|
47221
47212
|
}
|
|
@@ -48703,9 +48694,6 @@ function createBinder() {
|
|
|
48703
48694
|
}
|
|
48704
48695
|
// falls through
|
|
48705
48696
|
case 110 /* ThisKeyword */:
|
|
48706
|
-
if (node.kind === 110 /* ThisKeyword */) {
|
|
48707
|
-
seenThisKeyword = true;
|
|
48708
|
-
}
|
|
48709
48697
|
if (currentFlow && (isExpression(node) || parent2.kind === 305 /* ShorthandPropertyAssignment */)) {
|
|
48710
48698
|
node.flowNode = currentFlow;
|
|
48711
48699
|
}
|
|
@@ -49628,8 +49616,6 @@ function getContainerFlags(node) {
|
|
|
49628
49616
|
// falls through
|
|
49629
49617
|
case 177 /* Constructor */:
|
|
49630
49618
|
case 263 /* FunctionDeclaration */:
|
|
49631
|
-
case 176 /* ClassStaticBlockDeclaration */:
|
|
49632
|
-
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
49633
49619
|
case 174 /* MethodSignature */:
|
|
49634
49620
|
case 180 /* CallSignature */:
|
|
49635
49621
|
case 324 /* JSDocSignature */:
|
|
@@ -49637,14 +49623,17 @@ function getContainerFlags(node) {
|
|
|
49637
49623
|
case 185 /* FunctionType */:
|
|
49638
49624
|
case 181 /* ConstructSignature */:
|
|
49639
49625
|
case 186 /* ConstructorType */:
|
|
49640
|
-
|
|
49626
|
+
case 176 /* ClassStaticBlockDeclaration */:
|
|
49627
|
+
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
49641
49628
|
case 352 /* JSDocImportTag */:
|
|
49642
|
-
return 1 /* IsContainer */ | 32 /* HasLocals */;
|
|
49629
|
+
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
|
|
49643
49630
|
case 219 /* FunctionExpression */:
|
|
49644
49631
|
case 220 /* ArrowFunction */:
|
|
49645
49632
|
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
|
|
49646
49633
|
case 269 /* ModuleBlock */:
|
|
49647
49634
|
return 4 /* IsControlFlowContainer */;
|
|
49635
|
+
case 173 /* PropertyDeclaration */:
|
|
49636
|
+
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
|
|
49648
49637
|
case 300 /* CatchClause */:
|
|
49649
49638
|
case 249 /* ForStatement */:
|
|
49650
49639
|
case 250 /* ForInStatement */:
|
|
@@ -67179,7 +67168,7 @@ function createTypeChecker(host) {
|
|
|
67179
67168
|
context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper);
|
|
67180
67169
|
}
|
|
67181
67170
|
if (!checkTypeDeferred) {
|
|
67182
|
-
inferTypes(context.inferences, checkType, extendsType,
|
|
67171
|
+
inferTypes(context.inferences, checkType, extendsType, 1024 /* NoConstraints */ | 2048 /* AlwaysStrict */);
|
|
67183
67172
|
}
|
|
67184
67173
|
combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
|
|
67185
67174
|
}
|
|
@@ -68358,8 +68347,7 @@ function createTypeChecker(host) {
|
|
|
68358
68347
|
const { initializer } = node;
|
|
68359
68348
|
return !!initializer && isContextSensitive(initializer);
|
|
68360
68349
|
}
|
|
68361
|
-
case 295 /* JsxExpression */:
|
|
68362
|
-
case 230 /* YieldExpression */: {
|
|
68350
|
+
case 295 /* JsxExpression */: {
|
|
68363
68351
|
const { expression } = node;
|
|
68364
68352
|
return !!expression && isContextSensitive(expression);
|
|
68365
68353
|
}
|
|
@@ -68367,7 +68355,7 @@ function createTypeChecker(host) {
|
|
|
68367
68355
|
return false;
|
|
68368
68356
|
}
|
|
68369
68357
|
function isContextSensitiveFunctionLikeDeclaration(node) {
|
|
68370
|
-
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node)
|
|
68358
|
+
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
|
|
68371
68359
|
}
|
|
68372
68360
|
function hasContextSensitiveReturnExpression(node) {
|
|
68373
68361
|
if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
|
|
@@ -68858,9 +68846,9 @@ function createTypeChecker(host) {
|
|
|
68858
68846
|
const elem = getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic);
|
|
68859
68847
|
if (elem) {
|
|
68860
68848
|
result = elaborateElementwise(
|
|
68861
|
-
function* () {
|
|
68849
|
+
(function* () {
|
|
68862
68850
|
yield elem;
|
|
68863
|
-
}(),
|
|
68851
|
+
})(),
|
|
68864
68852
|
source,
|
|
68865
68853
|
target,
|
|
68866
68854
|
relation,
|
|
@@ -70867,7 +70855,7 @@ function createTypeChecker(host) {
|
|
|
70867
70855
|
0 /* None */,
|
|
70868
70856
|
isRelatedToWorker
|
|
70869
70857
|
);
|
|
70870
|
-
inferTypes(ctx.inferences, target2.extendsType, sourceExtends,
|
|
70858
|
+
inferTypes(ctx.inferences, target2.extendsType, sourceExtends, 1024 /* NoConstraints */ | 2048 /* AlwaysStrict */);
|
|
70871
70859
|
sourceExtends = instantiateType(sourceExtends, ctx.mapper);
|
|
70872
70860
|
mapper = ctx.mapper;
|
|
70873
70861
|
}
|
|
@@ -73132,7 +73120,7 @@ function createTypeChecker(host) {
|
|
|
73132
73120
|
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
73133
73121
|
let bivariant = false;
|
|
73134
73122
|
let propagationType;
|
|
73135
|
-
let inferencePriority =
|
|
73123
|
+
let inferencePriority = 4096 /* MaxValue */;
|
|
73136
73124
|
let visited;
|
|
73137
73125
|
let sourceStack;
|
|
73138
73126
|
let targetStack;
|
|
@@ -73207,13 +73195,18 @@ function createTypeChecker(host) {
|
|
|
73207
73195
|
if (candidate === blockedStringType) {
|
|
73208
73196
|
return;
|
|
73209
73197
|
}
|
|
73210
|
-
|
|
73198
|
+
const combinedPriority = priority | (inference.individualPriority || 0 /* None */);
|
|
73199
|
+
if (inference.priority === void 0 || priority < (inference.priority & ~512 /* DistributiveConditional */)) {
|
|
73211
73200
|
inference.candidates = void 0;
|
|
73212
73201
|
inference.contraCandidates = void 0;
|
|
73213
73202
|
inference.topLevel = true;
|
|
73214
|
-
inference.priority =
|
|
73203
|
+
inference.priority = combinedPriority;
|
|
73215
73204
|
}
|
|
73216
|
-
if (priority === inference.priority) {
|
|
73205
|
+
if (priority === (inference.priority & ~512 /* DistributiveConditional */)) {
|
|
73206
|
+
if (inference.priority !== combinedPriority) {
|
|
73207
|
+
inference.priority = combinedPriority;
|
|
73208
|
+
clearCachedInferences(inferences);
|
|
73209
|
+
}
|
|
73217
73210
|
if (contravariant && !bivariant) {
|
|
73218
73211
|
if (!contains(inference.contraCandidates, candidate)) {
|
|
73219
73212
|
inference.contraCandidates = append(inference.contraCandidates, candidate);
|
|
@@ -73295,7 +73288,7 @@ function createTypeChecker(host) {
|
|
|
73295
73288
|
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
73296
73289
|
invokeOnce(source, target, inferFromGenericMappedTypes);
|
|
73297
73290
|
}
|
|
73298
|
-
if (!(priority &
|
|
73291
|
+
if (!(priority & 1024 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
73299
73292
|
const apparentSource = getApparentType(source);
|
|
73300
73293
|
if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
|
|
73301
73294
|
return inferFromTypes(apparentSource, target);
|
|
@@ -73334,7 +73327,7 @@ function createTypeChecker(host) {
|
|
|
73334
73327
|
}
|
|
73335
73328
|
(visited || (visited = /* @__PURE__ */ new Map())).set(key, -1 /* Circularity */);
|
|
73336
73329
|
const saveInferencePriority = inferencePriority;
|
|
73337
|
-
inferencePriority =
|
|
73330
|
+
inferencePriority = 4096 /* MaxValue */;
|
|
73338
73331
|
const saveExpandingFlags = expandingFlags;
|
|
73339
73332
|
(sourceStack ?? (sourceStack = [])).push(source);
|
|
73340
73333
|
(targetStack ?? (targetStack = [])).push(target);
|
|
@@ -73384,7 +73377,7 @@ function createTypeChecker(host) {
|
|
|
73384
73377
|
contravariant = !contravariant;
|
|
73385
73378
|
}
|
|
73386
73379
|
function inferFromContravariantTypesIfStrictFunctionTypes(source, target) {
|
|
73387
|
-
if (strictFunctionTypes || priority &
|
|
73380
|
+
if (strictFunctionTypes || priority & 2048 /* AlwaysStrict */) {
|
|
73388
73381
|
inferFromContravariantTypes(source, target);
|
|
73389
73382
|
} else {
|
|
73390
73383
|
inferFromTypes(source, target);
|
|
@@ -73425,7 +73418,7 @@ function createTypeChecker(host) {
|
|
|
73425
73418
|
} else {
|
|
73426
73419
|
for (let i = 0; i < sources.length; i++) {
|
|
73427
73420
|
const saveInferencePriority = inferencePriority;
|
|
73428
|
-
inferencePriority =
|
|
73421
|
+
inferencePriority = 4096 /* MaxValue */;
|
|
73429
73422
|
inferFromTypes(sources[i], t);
|
|
73430
73423
|
if (inferencePriority === priority) matched[i] = true;
|
|
73431
73424
|
inferenceCircularity = inferenceCircularity || inferencePriority === -1 /* Circularity */;
|
|
@@ -73504,6 +73497,11 @@ function createTypeChecker(host) {
|
|
|
73504
73497
|
return false;
|
|
73505
73498
|
}
|
|
73506
73499
|
function inferToConditionalType(source, target) {
|
|
73500
|
+
const info = target.root.isDistributive ? getInferenceInfoForType(getActualTypeVariable(target.checkType)) : void 0;
|
|
73501
|
+
const saveIndividualPriority = info == null ? void 0 : info.individualPriority;
|
|
73502
|
+
if (info) {
|
|
73503
|
+
info.individualPriority = (info.individualPriority || 0 /* None */) | 512 /* DistributiveConditional */;
|
|
73504
|
+
}
|
|
73507
73505
|
if (source.flags & 16777216 /* Conditional */) {
|
|
73508
73506
|
inferFromTypes(source.checkType, target.checkType);
|
|
73509
73507
|
inferFromTypes(source.extendsType, target.extendsType);
|
|
@@ -73513,6 +73511,9 @@ function createTypeChecker(host) {
|
|
|
73513
73511
|
const targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)];
|
|
73514
73512
|
inferToMultipleTypesWithPriority(source, targetTypes, target.flags, contravariant ? 64 /* ContravariantConditional */ : 0);
|
|
73515
73513
|
}
|
|
73514
|
+
if (info) {
|
|
73515
|
+
info.individualPriority = saveIndividualPriority;
|
|
73516
|
+
}
|
|
73516
73517
|
}
|
|
73517
73518
|
function inferToTemplateLiteralType(source, target) {
|
|
73518
73519
|
const matches = inferTypesFromTemplateLiteralType(source, target);
|
|
@@ -73753,14 +73754,14 @@ function createTypeChecker(host) {
|
|
|
73753
73754
|
return candidates;
|
|
73754
73755
|
}
|
|
73755
73756
|
function getContravariantInference(inference) {
|
|
73756
|
-
return inference.priority &
|
|
73757
|
+
return inference.priority & 928 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
|
|
73757
73758
|
}
|
|
73758
73759
|
function getCovariantInference(inference, signature) {
|
|
73759
73760
|
const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
|
|
73760
73761
|
const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter);
|
|
73761
73762
|
const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter));
|
|
73762
73763
|
const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates;
|
|
73763
|
-
const unwidenedType = inference.priority &
|
|
73764
|
+
const unwidenedType = inference.priority & 928 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
|
|
73764
73765
|
return getWidenedType(unwidenedType);
|
|
73765
73766
|
}
|
|
73766
73767
|
function getInferredType(context, index) {
|
|
@@ -77867,7 +77868,7 @@ function createTypeChecker(host) {
|
|
|
77867
77868
|
concatenate(
|
|
77868
77869
|
map(
|
|
77869
77870
|
filter(node.properties, (p) => !!p.symbol && p.kind === 292 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))),
|
|
77870
|
-
(prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
|
|
77871
|
+
(prop) => [!prop.initializer ? (() => trueType) : (() => getContextFreeTypeOfExpression(prop.initializer)), prop.symbol.escapedName]
|
|
77871
77872
|
),
|
|
77872
77873
|
map(
|
|
77873
77874
|
filter(getPropertiesOfType(contextualType), (s) => {
|
|
@@ -77909,10 +77910,7 @@ function createTypeChecker(host) {
|
|
|
77909
77910
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
|
|
77910
77911
|
const inferenceContext = getInferenceContext(node);
|
|
77911
77912
|
if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
77912
|
-
|
|
77913
|
-
if (!(type.flags & 3 /* AnyOrUnknown */)) {
|
|
77914
|
-
return type;
|
|
77915
|
-
}
|
|
77913
|
+
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
77916
77914
|
}
|
|
77917
77915
|
if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
|
|
77918
77916
|
const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
|
|
@@ -80528,11 +80526,11 @@ function createTypeChecker(host) {
|
|
|
80528
80526
|
Debug.assert(typeParameters[i] !== void 0, "Should not call checkTypeArguments with too many type arguments");
|
|
80529
80527
|
const constraint = getConstraintOfTypeParameter(typeParameters[i]);
|
|
80530
80528
|
if (constraint) {
|
|
80531
|
-
const errorInfo = reportErrors2 && headMessage ? () => chainDiagnosticMessages(
|
|
80529
|
+
const errorInfo = reportErrors2 && headMessage ? (() => chainDiagnosticMessages(
|
|
80532
80530
|
/*details*/
|
|
80533
80531
|
void 0,
|
|
80534
80532
|
Diagnostics.Type_0_does_not_satisfy_the_constraint_1
|
|
80535
|
-
) : void 0;
|
|
80533
|
+
)) : void 0;
|
|
80536
80534
|
const typeArgumentHeadMessage = headMessage || Diagnostics.Type_0_does_not_satisfy_the_constraint_1;
|
|
80537
80535
|
if (!mapper) {
|
|
80538
80536
|
mapper = createTypeMapper(typeParameters, typeArgumentTypes);
|
|
@@ -81515,12 +81513,9 @@ function createTypeChecker(host) {
|
|
|
81515
81513
|
}
|
|
81516
81514
|
return resolveErrorCall(node);
|
|
81517
81515
|
}
|
|
81518
|
-
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments) {
|
|
81519
|
-
|
|
81520
|
-
|
|
81521
|
-
skippedGenericFunction(node, checkMode);
|
|
81522
|
-
return resolvingSignature;
|
|
81523
|
-
}
|
|
81516
|
+
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
|
|
81517
|
+
skippedGenericFunction(node, checkMode);
|
|
81518
|
+
return resolvingSignature;
|
|
81524
81519
|
}
|
|
81525
81520
|
if (callSignatures.some((sig) => isInJSFile(sig.declaration) && !!getJSDocClassTag(sig.declaration))) {
|
|
81526
81521
|
error2(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
|
|
@@ -94964,7 +94959,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
|
|
|
94964
94959
|
isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
|
|
94965
94960
|
fileExists: (fileName) => host.fileExists(fileName),
|
|
94966
94961
|
getFileIncludeReasons: () => host.getFileIncludeReasons(),
|
|
94967
|
-
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0,
|
|
94962
|
+
readFile: host.readFile ? ((fileName) => host.readFile(fileName)) : void 0,
|
|
94968
94963
|
getDefaultResolutionModeForFile: (file) => host.getDefaultResolutionModeForFile(file),
|
|
94969
94964
|
getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index),
|
|
94970
94965
|
getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
|
|
@@ -103852,7 +103847,7 @@ function transformESDecorators(context) {
|
|
|
103852
103847
|
} else {
|
|
103853
103848
|
Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name.");
|
|
103854
103849
|
const iife = transformClassLike(node);
|
|
103855
|
-
const modifierVisitorNoExport = isExport ? (node2) => isExportModifier(node2) ? void 0 : modifierVisitor(node2) : modifierVisitor;
|
|
103850
|
+
const modifierVisitorNoExport = isExport ? ((node2) => isExportModifier(node2) ? void 0 : modifierVisitor(node2)) : modifierVisitor;
|
|
103856
103851
|
const modifiers = visitNodes2(node.modifiers, modifierVisitorNoExport, isModifier);
|
|
103857
103852
|
const declName = factory2.getLocalName(
|
|
103858
103853
|
node,
|
|
@@ -133793,7 +133788,7 @@ var WatchType = {
|
|
|
133793
133788
|
};
|
|
133794
133789
|
function createWatchFactory(host, options) {
|
|
133795
133790
|
const watchLogLevel = host.trace ? options.extendedDiagnostics ? 2 /* Verbose */ : options.diagnostics ? 1 /* TriggerOnly */ : 0 /* None */ : 0 /* None */;
|
|
133796
|
-
const writeLog = watchLogLevel !== 0 /* None */ ? (s) => host.trace(s) : noop;
|
|
133791
|
+
const writeLog = watchLogLevel !== 0 /* None */ ? ((s) => host.trace(s)) : noop;
|
|
133797
133792
|
const result = getWatchFactory(host, watchLogLevel, writeLog);
|
|
133798
133793
|
result.writeLog = writeLog;
|
|
133799
133794
|
return result;
|
|
@@ -134127,7 +134122,7 @@ function createWatchProgram(host) {
|
|
|
134127
134122
|
compilerHost.resolveTypeReferenceDirectiveReferences = resolutionCache.resolveTypeReferenceDirectiveReferences.bind(resolutionCache);
|
|
134128
134123
|
}
|
|
134129
134124
|
compilerHost.resolveLibrary = !host.resolveLibrary ? resolutionCache.resolveLibrary.bind(resolutionCache) : host.resolveLibrary.bind(host);
|
|
134130
|
-
compilerHost.getModuleResolutionCache = host.resolveModuleNameLiterals || host.resolveModuleNames ? maybeBind(host, host.getModuleResolutionCache) : () => resolutionCache.getModuleResolutionCache();
|
|
134125
|
+
compilerHost.getModuleResolutionCache = host.resolveModuleNameLiterals || host.resolveModuleNames ? maybeBind(host, host.getModuleResolutionCache) : (() => resolutionCache.getModuleResolutionCache());
|
|
134131
134126
|
const userProvidedResolution = !!host.resolveModuleNameLiterals || !!host.resolveTypeReferenceDirectiveReferences || !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
134132
134127
|
const customHasInvalidatedResolutions = userProvidedResolution ? maybeBind(host, host.hasInvalidatedResolutions) || returnTrue : returnFalse;
|
|
134133
134128
|
const customHasInvalidLibResolutions = host.resolveLibrary ? maybeBind(host, host.hasInvalidatedLibResolutions) || returnTrue : returnFalse;
|
|
@@ -142426,7 +142421,7 @@ function forEachExternalModule(checker, allSourceFiles, excludePatterns, host, c
|
|
|
142426
142421
|
function getIsExcluded(excludePatterns, host) {
|
|
142427
142422
|
var _a;
|
|
142428
142423
|
const realpathsWithSymlinks = (_a = host.getSymlinkCache) == null ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
142429
|
-
return ({ fileName, path }) => {
|
|
142424
|
+
return (({ fileName, path }) => {
|
|
142430
142425
|
if (excludePatterns.some((p) => p.test(fileName))) return true;
|
|
142431
142426
|
if ((realpathsWithSymlinks == null ? void 0 : realpathsWithSymlinks.size) && pathContainsNodeModules(fileName)) {
|
|
142432
142427
|
let dir = getDirectoryPath(fileName);
|
|
@@ -142443,7 +142438,7 @@ function getIsExcluded(excludePatterns, host) {
|
|
|
142443
142438
|
) ?? false;
|
|
142444
142439
|
}
|
|
142445
142440
|
return false;
|
|
142446
|
-
};
|
|
142441
|
+
});
|
|
142447
142442
|
}
|
|
142448
142443
|
function getIsFileExcluded(host, preferences) {
|
|
142449
142444
|
if (!preferences.autoImportFileExcludePatterns) return () => false;
|
|
@@ -185849,7 +185844,7 @@ var TypingsInstaller = class {
|
|
|
185849
185844
|
}
|
|
185850
185845
|
const discoverTypingsResult = ts_JsTyping_exports.discoverTypings(
|
|
185851
185846
|
this.installTypingHost,
|
|
185852
|
-
this.log.isEnabled() ? (s) => this.log.writeLine(s) : void 0,
|
|
185847
|
+
this.log.isEnabled() ? ((s) => this.log.writeLine(s)) : void 0,
|
|
185853
185848
|
req.fileNames,
|
|
185854
185849
|
req.projectRootPath,
|
|
185855
185850
|
this.safeList,
|
|
@@ -190061,7 +190056,7 @@ var _ProjectService = class _ProjectService {
|
|
|
190061
190056
|
this
|
|
190062
190057
|
);
|
|
190063
190058
|
const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */;
|
|
190064
|
-
const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop;
|
|
190059
|
+
const log = watchLogLevel !== 0 /* None */ ? ((s) => this.logger.info(s)) : noop;
|
|
190065
190060
|
this.packageJsonCache = createPackageJsonCache(this);
|
|
190066
190061
|
this.watchFactory = this.serverMode !== 0 /* Semantic */ ? {
|
|
190067
190062
|
watchFile: returnNoopFileWatcher,
|
|
@@ -190525,7 +190520,7 @@ var _ProjectService = class _ProjectService {
|
|
|
190525
190520
|
useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames,
|
|
190526
190521
|
writeLog: (s) => this.logger.info(s),
|
|
190527
190522
|
toPath: (s) => this.toPath(s),
|
|
190528
|
-
getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0
|
|
190523
|
+
getScriptKind: configuredProjectForConfig ? ((fileName) => configuredProjectForConfig.getScriptKind(fileName)) : void 0
|
|
190529
190524
|
})) return;
|
|
190530
190525
|
if (config.updateLevel !== 2 /* Full */) config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
190531
190526
|
config.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => {
|
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-62093-9",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -42,46 +42,45 @@
|
|
|
42
42
|
"@dprint/formatter": "^0.4.1",
|
|
43
43
|
"@dprint/typescript": "0.93.4",
|
|
44
44
|
"@esfx/canceltoken": "^1.0.0",
|
|
45
|
-
"@eslint/js": "^9.
|
|
45
|
+
"@eslint/js": "^9.33.0",
|
|
46
46
|
"@octokit/rest": "^21.1.1",
|
|
47
47
|
"@types/chai": "^4.3.20",
|
|
48
|
-
"@types/diff": "^7.0.1",
|
|
49
48
|
"@types/minimist": "^1.2.5",
|
|
50
49
|
"@types/mocha": "^10.0.10",
|
|
51
50
|
"@types/ms": "^0.7.34",
|
|
52
51
|
"@types/node": "latest",
|
|
53
52
|
"@types/source-map-support": "^0.5.10",
|
|
54
53
|
"@types/which": "^3.0.4",
|
|
55
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
56
|
-
"@typescript-eslint/type-utils": "^8.
|
|
57
|
-
"@typescript-eslint/utils": "^8.
|
|
58
|
-
"azure-devops-node-api": "^
|
|
54
|
+
"@typescript-eslint/rule-tester": "^8.39.1",
|
|
55
|
+
"@typescript-eslint/type-utils": "^8.39.1",
|
|
56
|
+
"@typescript-eslint/utils": "^8.39.1",
|
|
57
|
+
"azure-devops-node-api": "^15.1.1",
|
|
59
58
|
"c8": "^10.1.3",
|
|
60
59
|
"chai": "^4.5.0",
|
|
61
60
|
"chokidar": "^4.0.3",
|
|
62
|
-
"diff": "^
|
|
63
|
-
"dprint": "^0.49.
|
|
64
|
-
"esbuild": "^0.25.
|
|
65
|
-
"eslint": "^9.
|
|
61
|
+
"diff": "^8.0.2",
|
|
62
|
+
"dprint": "^0.49.1",
|
|
63
|
+
"esbuild": "^0.25.9",
|
|
64
|
+
"eslint": "^9.33.0",
|
|
66
65
|
"eslint-formatter-autolinkable-stylish": "^1.4.0",
|
|
67
|
-
"eslint-plugin-regexp": "^2.
|
|
68
|
-
"fast-xml-parser": "^
|
|
66
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
67
|
+
"fast-xml-parser": "^5.2.5",
|
|
69
68
|
"glob": "^10.4.5",
|
|
70
|
-
"globals": "^
|
|
71
|
-
"hereby": "^1.
|
|
69
|
+
"globals": "^16.3.0",
|
|
70
|
+
"hereby": "^1.11.0",
|
|
72
71
|
"jsonc-parser": "^3.3.1",
|
|
73
|
-
"knip": "^5.
|
|
72
|
+
"knip": "^5.62.0",
|
|
74
73
|
"minimist": "^1.2.8",
|
|
75
74
|
"mocha": "^10.8.2",
|
|
76
75
|
"mocha-fivemat-progress-reporter": "^0.1.0",
|
|
77
|
-
"monocart-coverage-reports": "^2.12.
|
|
76
|
+
"monocart-coverage-reports": "^2.12.6",
|
|
78
77
|
"ms": "^2.1.3",
|
|
79
78
|
"picocolors": "^1.1.1",
|
|
80
|
-
"playwright": "^1.
|
|
79
|
+
"playwright": "^1.54.2",
|
|
81
80
|
"source-map-support": "^0.5.21",
|
|
82
81
|
"tslib": "^2.8.1",
|
|
83
|
-
"typescript": "^5.
|
|
84
|
-
"typescript-eslint": "^8.
|
|
82
|
+
"typescript": "^5.9.2",
|
|
83
|
+
"typescript-eslint": "^8.39.1",
|
|
85
84
|
"which": "^3.0.1"
|
|
86
85
|
},
|
|
87
86
|
"overrides": {
|