@typescript-deploys/pr-build 5.4.0-pr-57394-2 → 5.5.0-pr-57403-12
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 +74 -51
- package/lib/tsserver.js +96 -62
- package/lib/typescript.d.ts +2 -1
- package/lib/typescript.js +95 -62
- package/lib/typingsInstaller.js +3 -2
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -17,8 +17,8 @@ and limitations under the License.
|
|
|
17
17
|
"use strict";
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
|
-
var versionMajorMinor = "5.
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
20
|
+
var versionMajorMinor = "5.5";
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240221`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3708,6 +3708,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
3708
3708
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
3709
3709
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
3710
3710
|
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
|
|
3711
|
+
ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType";
|
|
3711
3712
|
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
|
|
3712
3713
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
|
|
3713
3714
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
|
|
@@ -48774,7 +48775,7 @@ function createTypeChecker(host) {
|
|
|
48774
48775
|
}
|
|
48775
48776
|
const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
|
|
48776
48777
|
if (some(abstractSignatures)) {
|
|
48777
|
-
const types = map(abstractSignatures, getOrCreateTypeFromSignature);
|
|
48778
|
+
const types = map(abstractSignatures, (s) => getOrCreateTypeFromSignature(s));
|
|
48778
48779
|
const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
|
|
48779
48780
|
// the logic in `createTypeNodesFromResolvedType`.
|
|
48780
48781
|
(context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
|
|
@@ -55315,11 +55316,15 @@ function createTypeChecker(host) {
|
|
|
55315
55316
|
return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type));
|
|
55316
55317
|
}
|
|
55317
55318
|
function getResolvedApparentTypeOfMappedType(type) {
|
|
55318
|
-
const
|
|
55319
|
-
|
|
55320
|
-
|
|
55321
|
-
|
|
55322
|
-
|
|
55319
|
+
const target = type.target ?? type;
|
|
55320
|
+
const typeVariable = getHomomorphicTypeVariable(target);
|
|
55321
|
+
if (typeVariable && !target.declaration.nameType) {
|
|
55322
|
+
const constraint = getConstraintTypeFromMappedType(type);
|
|
55323
|
+
if (constraint.flags & 4194304 /* Index */) {
|
|
55324
|
+
const baseConstraint = getBaseConstraintOfType(constraint.type);
|
|
55325
|
+
if (baseConstraint && everyType(baseConstraint, isArrayOrTupleType)) {
|
|
55326
|
+
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
55327
|
+
}
|
|
55323
55328
|
}
|
|
55324
55329
|
}
|
|
55325
55330
|
return type;
|
|
@@ -56164,6 +56169,12 @@ function createTypeChecker(host) {
|
|
|
56164
56169
|
isInJSFile(signature.declaration)
|
|
56165
56170
|
);
|
|
56166
56171
|
}
|
|
56172
|
+
function getImplementationSignature(signature) {
|
|
56173
|
+
return signature.typeParameters ? signature.implementationSignatureCache || (signature.implementationSignatureCache = createImplementationSignature(signature)) : signature;
|
|
56174
|
+
}
|
|
56175
|
+
function createImplementationSignature(signature) {
|
|
56176
|
+
return signature.typeParameters ? instantiateSignature(signature, createTypeMapper([], [])) : signature;
|
|
56177
|
+
}
|
|
56167
56178
|
function getBaseSignature(signature) {
|
|
56168
56179
|
const typeParameters = signature.typeParameters;
|
|
56169
56180
|
if (typeParameters) {
|
|
@@ -56186,12 +56197,22 @@ function createTypeChecker(host) {
|
|
|
56186
56197
|
}
|
|
56187
56198
|
return signature;
|
|
56188
56199
|
}
|
|
56189
|
-
function getOrCreateTypeFromSignature(signature) {
|
|
56200
|
+
function getOrCreateTypeFromSignature(signature, outerTypeParameters) {
|
|
56190
56201
|
var _a;
|
|
56191
56202
|
if (!signature.isolatedSignatureType) {
|
|
56192
56203
|
const kind = (_a = signature.declaration) == null ? void 0 : _a.kind;
|
|
56193
56204
|
const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
|
|
56194
|
-
const type = createObjectType(16 /* Anonymous */);
|
|
56205
|
+
const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */));
|
|
56206
|
+
if (signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
56207
|
+
type.symbol.declarations = [signature.declaration];
|
|
56208
|
+
type.symbol.valueDeclaration = signature.declaration;
|
|
56209
|
+
}
|
|
56210
|
+
outerTypeParameters || (outerTypeParameters = signature.declaration && getOuterTypeParameters(
|
|
56211
|
+
signature.declaration,
|
|
56212
|
+
/*includeThisTypes*/
|
|
56213
|
+
true
|
|
56214
|
+
));
|
|
56215
|
+
type.outerTypeParameters = outerTypeParameters;
|
|
56195
56216
|
type.members = emptySymbols;
|
|
56196
56217
|
type.properties = emptyArray;
|
|
56197
56218
|
type.callSignatures = !isConstructor ? [signature] : emptyArray;
|
|
@@ -57358,7 +57379,7 @@ function createTypeChecker(host) {
|
|
|
57358
57379
|
return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
|
|
57359
57380
|
}
|
|
57360
57381
|
function createNormalizedTupleType(target, elementTypes) {
|
|
57361
|
-
var _a, _b, _c;
|
|
57382
|
+
var _a, _b, _c, _d;
|
|
57362
57383
|
if (!(target.combinedFlags & 14 /* NonRequired */)) {
|
|
57363
57384
|
return createTypeReference(target, elementTypes);
|
|
57364
57385
|
}
|
|
@@ -57378,8 +57399,10 @@ function createTypeChecker(host) {
|
|
|
57378
57399
|
const type = elementTypes[i];
|
|
57379
57400
|
const flags = target.elementFlags[i];
|
|
57380
57401
|
if (flags & 8 /* Variadic */) {
|
|
57381
|
-
if (type.flags &
|
|
57382
|
-
addElement(type,
|
|
57402
|
+
if (type.flags & 1 /* Any */) {
|
|
57403
|
+
addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
|
|
57404
|
+
} else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
|
|
57405
|
+
addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
|
|
57383
57406
|
} else if (isTupleType(type)) {
|
|
57384
57407
|
const elements = getElementTypes(type);
|
|
57385
57408
|
if (elements.length + expandedTypes.length >= 1e4) {
|
|
@@ -57394,10 +57417,10 @@ function createTypeChecker(host) {
|
|
|
57394
57417
|
return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
|
|
57395
57418
|
});
|
|
57396
57419
|
} else {
|
|
57397
|
-
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (
|
|
57420
|
+
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
|
|
57398
57421
|
}
|
|
57399
57422
|
} else {
|
|
57400
|
-
addElement(type, flags, (
|
|
57423
|
+
addElement(type, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i]);
|
|
57401
57424
|
}
|
|
57402
57425
|
}
|
|
57403
57426
|
for (let i = 0; i < lastRequiredIndex; i++) {
|
|
@@ -58761,10 +58784,6 @@ function createTypeChecker(host) {
|
|
|
58761
58784
|
}
|
|
58762
58785
|
return type;
|
|
58763
58786
|
}
|
|
58764
|
-
function maybeCloneTypeParameter(p) {
|
|
58765
|
-
const constraint = getConstraintOfTypeParameter(p);
|
|
58766
|
-
return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
|
|
58767
|
-
}
|
|
58768
58787
|
function isSimpleTupleType(node) {
|
|
58769
58788
|
return isTupleTypeNode(node) && length(node.elements) > 0 && !some(node.elements, (e) => isOptionalTypeNode(e) || isRestTypeNode(e) || isNamedTupleMember(e) && !!(e.questionToken || e.dotDotDotToken));
|
|
58770
58789
|
}
|
|
@@ -58794,27 +58813,19 @@ function createTypeChecker(host) {
|
|
|
58794
58813
|
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
|
58795
58814
|
let combinedMapper;
|
|
58796
58815
|
if (root.inferTypeParameters) {
|
|
58797
|
-
const freshParams = sameMap(root.inferTypeParameters, maybeCloneTypeParameter);
|
|
58798
|
-
const freshMapper = freshParams !== root.inferTypeParameters ? createTypeMapper(root.inferTypeParameters, freshParams) : void 0;
|
|
58799
58816
|
const context = createInferenceContext(
|
|
58800
|
-
|
|
58817
|
+
root.inferTypeParameters,
|
|
58801
58818
|
/*signature*/
|
|
58802
58819
|
void 0,
|
|
58803
58820
|
0 /* None */
|
|
58804
58821
|
);
|
|
58805
|
-
if (
|
|
58806
|
-
|
|
58807
|
-
for (let i = 0; i < freshParams.length; i++) {
|
|
58808
|
-
if (freshParams[i] !== root.inferTypeParameters[i]) {
|
|
58809
|
-
freshParams[i].mapper = freshCombinedMapper;
|
|
58810
|
-
}
|
|
58811
|
-
}
|
|
58822
|
+
if (mapper) {
|
|
58823
|
+
context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper);
|
|
58812
58824
|
}
|
|
58813
58825
|
if (!checkTypeDeferred) {
|
|
58814
|
-
inferTypes(context.inferences, checkType,
|
|
58826
|
+
inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
|
|
58815
58827
|
}
|
|
58816
|
-
|
|
58817
|
-
combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
|
|
58828
|
+
combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
|
|
58818
58829
|
}
|
|
58819
58830
|
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
|
58820
58831
|
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
|
@@ -59594,7 +59605,7 @@ function createTypeChecker(host) {
|
|
|
59594
59605
|
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0];
|
|
59595
59606
|
const links = getNodeLinks(declaration);
|
|
59596
59607
|
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
59597
|
-
let typeParameters = links.outerTypeParameters;
|
|
59608
|
+
let typeParameters = type.objectFlags & 134217728 /* SingleSignatureType */ ? type.outerTypeParameters : links.outerTypeParameters;
|
|
59598
59609
|
if (!typeParameters) {
|
|
59599
59610
|
let outerTypeParameters = getOuterTypeParameters(
|
|
59600
59611
|
declaration,
|
|
@@ -59775,6 +59786,9 @@ function createTypeChecker(host) {
|
|
|
59775
59786
|
if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
|
|
59776
59787
|
result.node = type.node;
|
|
59777
59788
|
}
|
|
59789
|
+
if (type.objectFlags & 134217728 /* SingleSignatureType */) {
|
|
59790
|
+
result.outerTypeParameters = type.outerTypeParameters;
|
|
59791
|
+
}
|
|
59778
59792
|
result.target = type;
|
|
59779
59793
|
result.mapper = mapper;
|
|
59780
59794
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -60666,8 +60680,8 @@ function createTypeChecker(host) {
|
|
|
60666
60680
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
60667
60681
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
60668
60682
|
for (let i = 0; i < paramCount; i++) {
|
|
60669
|
-
const sourceType = i === restIndex ?
|
|
60670
|
-
const targetType = i === restIndex ?
|
|
60683
|
+
const sourceType = i === restIndex ? getRestOrAnyTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
|
|
60684
|
+
const targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
60671
60685
|
if (sourceType && targetType) {
|
|
60672
60686
|
const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
60673
60687
|
const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
|
|
@@ -64395,7 +64409,7 @@ function createTypeChecker(host) {
|
|
|
64395
64409
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
64396
64410
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
64397
64411
|
}
|
|
64398
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
64412
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 134217728 /* SingleSignatureType */ && !!length(type.outerTypeParameters) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
64399
64413
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
64400
64414
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
64401
64415
|
}
|
|
@@ -64677,6 +64691,9 @@ function createTypeChecker(host) {
|
|
|
64677
64691
|
pos = p;
|
|
64678
64692
|
}
|
|
64679
64693
|
}
|
|
64694
|
+
function isTupleOfSelf(typeParameter, type) {
|
|
64695
|
+
return isTupleType(type) && getTupleElementType(type, 0) === getIndexedAccessType(typeParameter, getNumberLiteralType(0)) && !getTypeOfPropertyOfType(type, "1");
|
|
64696
|
+
}
|
|
64680
64697
|
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
64681
64698
|
let bivariant = false;
|
|
64682
64699
|
let propagationType;
|
|
@@ -64762,6 +64779,9 @@ function createTypeChecker(host) {
|
|
|
64762
64779
|
inference.priority = priority;
|
|
64763
64780
|
}
|
|
64764
64781
|
if (priority === inference.priority) {
|
|
64782
|
+
if (isTupleOfSelf(inference.typeParameter, candidate)) {
|
|
64783
|
+
return;
|
|
64784
|
+
}
|
|
64765
64785
|
if (contravariant && !bivariant) {
|
|
64766
64786
|
if (!contains(inference.contraCandidates, candidate)) {
|
|
64767
64787
|
inference.contraCandidates = append(inference.contraCandidates, candidate);
|
|
@@ -65328,9 +65348,7 @@ function createTypeChecker(host) {
|
|
|
65328
65348
|
inferredType = silentNeverType;
|
|
65329
65349
|
} else {
|
|
65330
65350
|
const defaultType = getDefaultFromTypeParameter(inference.typeParameter);
|
|
65331
|
-
|
|
65332
|
-
inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
|
|
65333
|
-
}
|
|
65351
|
+
inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
|
|
65334
65352
|
}
|
|
65335
65353
|
} else {
|
|
65336
65354
|
inferredType = getTypeFromInference(inference);
|
|
@@ -71718,7 +71736,7 @@ function createTypeChecker(host) {
|
|
|
71718
71736
|
void 0,
|
|
71719
71737
|
checkMode
|
|
71720
71738
|
);
|
|
71721
|
-
const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
|
|
71739
|
+
const checkArgType = instantiateType(checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType, signature.mapper);
|
|
71722
71740
|
const effectiveCheckArgumentNode = getEffectiveCheckNode(arg);
|
|
71723
71741
|
if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) {
|
|
71724
71742
|
Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors");
|
|
@@ -72262,13 +72280,16 @@ function createTypeChecker(host) {
|
|
|
72262
72280
|
return candidate;
|
|
72263
72281
|
}
|
|
72264
72282
|
for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) {
|
|
72265
|
-
|
|
72283
|
+
let candidate = candidates2[candidateIndex];
|
|
72266
72284
|
if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) {
|
|
72267
72285
|
continue;
|
|
72268
72286
|
}
|
|
72269
72287
|
let checkCandidate;
|
|
72270
72288
|
let inferenceContext;
|
|
72271
72289
|
if (candidate.typeParameters) {
|
|
72290
|
+
if (candidate.declaration && findAncestor(node, (a) => a === candidate.declaration)) {
|
|
72291
|
+
candidate = getImplementationSignature(candidate);
|
|
72292
|
+
}
|
|
72272
72293
|
let typeArgumentTypes;
|
|
72273
72294
|
if (some(typeArguments)) {
|
|
72274
72295
|
typeArgumentTypes = checkTypeArguments(
|
|
@@ -72288,7 +72309,7 @@ function createTypeChecker(host) {
|
|
|
72288
72309
|
/*flags*/
|
|
72289
72310
|
isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */
|
|
72290
72311
|
);
|
|
72291
|
-
typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext);
|
|
72312
|
+
typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext), inferenceContext.nonFixingMapper);
|
|
72292
72313
|
argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */;
|
|
72293
72314
|
}
|
|
72294
72315
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
|
|
@@ -72316,7 +72337,7 @@ function createTypeChecker(host) {
|
|
|
72316
72337
|
if (argCheckMode) {
|
|
72317
72338
|
argCheckMode = 0 /* Normal */;
|
|
72318
72339
|
if (inferenceContext) {
|
|
72319
|
-
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
72340
|
+
const typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext), inferenceContext.mapper);
|
|
72320
72341
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
72321
72342
|
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) {
|
|
72322
72343
|
candidateForArgumentArityError = checkCandidate;
|
|
@@ -73670,6 +73691,11 @@ function createTypeChecker(host) {
|
|
|
73670
73691
|
}
|
|
73671
73692
|
return createTupleType(types, flags, readonly, names);
|
|
73672
73693
|
}
|
|
73694
|
+
function getRestOrAnyTypeAtPosition(source, pos) {
|
|
73695
|
+
const restType = getRestTypeAtPosition(source, pos);
|
|
73696
|
+
const elementType = restType && getElementTypeOfArrayType(restType);
|
|
73697
|
+
return elementType && isTypeAny(elementType) ? anyType : restType;
|
|
73698
|
+
}
|
|
73673
73699
|
function getParameterCount(signature) {
|
|
73674
73700
|
const length2 = signature.parameters.length;
|
|
73675
73701
|
if (signatureHasRestParameter(signature)) {
|
|
@@ -73726,7 +73752,7 @@ function createTypeChecker(host) {
|
|
|
73726
73752
|
if (signatureHasRestParameter(signature)) {
|
|
73727
73753
|
const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
|
|
73728
73754
|
if (!isTupleType(restType)) {
|
|
73729
|
-
return restType;
|
|
73755
|
+
return isTypeAny(restType) ? anyArrayType : restType;
|
|
73730
73756
|
}
|
|
73731
73757
|
if (restType.target.hasRestElement) {
|
|
73732
73758
|
return sliceTupleType(restType, restType.target.fixedLength);
|
|
@@ -76028,7 +76054,7 @@ function createTypeChecker(host) {
|
|
|
76028
76054
|
}
|
|
76029
76055
|
}
|
|
76030
76056
|
}
|
|
76031
|
-
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context));
|
|
76057
|
+
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context), flatMap(inferenceContexts, (c) => c && map(c.inferences, (i) => i.typeParameter)).slice());
|
|
76032
76058
|
}
|
|
76033
76059
|
}
|
|
76034
76060
|
}
|
|
@@ -77030,20 +77056,17 @@ function createTypeChecker(host) {
|
|
|
77030
77056
|
const objectType = type.objectType;
|
|
77031
77057
|
const indexType = type.indexType;
|
|
77032
77058
|
const objectIndexType = isGenericMappedType(objectType) && getMappedTypeNameTypeKind(objectType) === 2 /* Remapping */ ? getIndexTypeForMappedType(objectType, 0 /* None */) : getIndexType(objectType, 0 /* None */);
|
|
77033
|
-
|
|
77059
|
+
const hasNumberIndexInfo = !!getIndexInfoOfType(objectType, numberType);
|
|
77060
|
+
if (everyType(indexType, (t) => isTypeAssignableTo(t, objectIndexType) || hasNumberIndexInfo && isApplicableIndexType(t, numberType))) {
|
|
77034
77061
|
if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
|
|
77035
77062
|
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
|
|
77036
77063
|
}
|
|
77037
77064
|
return type;
|
|
77038
77065
|
}
|
|
77039
|
-
const apparentObjectType = getApparentType(objectType);
|
|
77040
|
-
if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
|
|
77041
|
-
return type;
|
|
77042
|
-
}
|
|
77043
77066
|
if (isGenericObjectType(objectType)) {
|
|
77044
77067
|
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
|
|
77045
77068
|
if (propertyName) {
|
|
77046
|
-
const propertySymbol = forEachType(
|
|
77069
|
+
const propertySymbol = forEachType(getApparentType(objectType), (t) => getPropertyOfType(t, propertyName));
|
|
77047
77070
|
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
77048
77071
|
error(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
|
|
77049
77072
|
return errorType;
|
package/lib/tsserver.js
CHANGED
|
@@ -1231,6 +1231,7 @@ __export(server_exports, {
|
|
|
1231
1231
|
isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern,
|
|
1232
1232
|
isBindingPattern: () => isBindingPattern,
|
|
1233
1233
|
isBlock: () => isBlock,
|
|
1234
|
+
isBlockLike: () => isBlockLike,
|
|
1234
1235
|
isBlockOrCatchScoped: () => isBlockOrCatchScoped,
|
|
1235
1236
|
isBlockScope: () => isBlockScope,
|
|
1236
1237
|
isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel,
|
|
@@ -2339,8 +2340,8 @@ __export(server_exports, {
|
|
|
2339
2340
|
module.exports = __toCommonJS(server_exports);
|
|
2340
2341
|
|
|
2341
2342
|
// src/compiler/corePublic.ts
|
|
2342
|
-
var versionMajorMinor = "5.
|
|
2343
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2343
|
+
var versionMajorMinor = "5.5";
|
|
2344
|
+
var version = `${versionMajorMinor}.0-insiders.20240221`;
|
|
2344
2345
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2345
2346
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2346
2347
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6732,6 +6733,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
6732
6733
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
6733
6734
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
6734
6735
|
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
|
|
6736
|
+
ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType";
|
|
6735
6737
|
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
|
|
6736
6738
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
|
|
6737
6739
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
|
|
@@ -53518,7 +53520,7 @@ function createTypeChecker(host) {
|
|
|
53518
53520
|
}
|
|
53519
53521
|
const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
|
|
53520
53522
|
if (some(abstractSignatures)) {
|
|
53521
|
-
const types = map(abstractSignatures, getOrCreateTypeFromSignature);
|
|
53523
|
+
const types = map(abstractSignatures, (s) => getOrCreateTypeFromSignature(s));
|
|
53522
53524
|
const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
|
|
53523
53525
|
// the logic in `createTypeNodesFromResolvedType`.
|
|
53524
53526
|
(context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
|
|
@@ -60059,11 +60061,15 @@ function createTypeChecker(host) {
|
|
|
60059
60061
|
return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type));
|
|
60060
60062
|
}
|
|
60061
60063
|
function getResolvedApparentTypeOfMappedType(type) {
|
|
60062
|
-
const
|
|
60063
|
-
|
|
60064
|
-
|
|
60065
|
-
|
|
60066
|
-
|
|
60064
|
+
const target = type.target ?? type;
|
|
60065
|
+
const typeVariable = getHomomorphicTypeVariable(target);
|
|
60066
|
+
if (typeVariable && !target.declaration.nameType) {
|
|
60067
|
+
const constraint = getConstraintTypeFromMappedType(type);
|
|
60068
|
+
if (constraint.flags & 4194304 /* Index */) {
|
|
60069
|
+
const baseConstraint = getBaseConstraintOfType(constraint.type);
|
|
60070
|
+
if (baseConstraint && everyType(baseConstraint, isArrayOrTupleType)) {
|
|
60071
|
+
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
60072
|
+
}
|
|
60067
60073
|
}
|
|
60068
60074
|
}
|
|
60069
60075
|
return type;
|
|
@@ -60908,6 +60914,12 @@ function createTypeChecker(host) {
|
|
|
60908
60914
|
isInJSFile(signature.declaration)
|
|
60909
60915
|
);
|
|
60910
60916
|
}
|
|
60917
|
+
function getImplementationSignature(signature) {
|
|
60918
|
+
return signature.typeParameters ? signature.implementationSignatureCache || (signature.implementationSignatureCache = createImplementationSignature(signature)) : signature;
|
|
60919
|
+
}
|
|
60920
|
+
function createImplementationSignature(signature) {
|
|
60921
|
+
return signature.typeParameters ? instantiateSignature(signature, createTypeMapper([], [])) : signature;
|
|
60922
|
+
}
|
|
60911
60923
|
function getBaseSignature(signature) {
|
|
60912
60924
|
const typeParameters = signature.typeParameters;
|
|
60913
60925
|
if (typeParameters) {
|
|
@@ -60930,12 +60942,22 @@ function createTypeChecker(host) {
|
|
|
60930
60942
|
}
|
|
60931
60943
|
return signature;
|
|
60932
60944
|
}
|
|
60933
|
-
function getOrCreateTypeFromSignature(signature) {
|
|
60945
|
+
function getOrCreateTypeFromSignature(signature, outerTypeParameters) {
|
|
60934
60946
|
var _a;
|
|
60935
60947
|
if (!signature.isolatedSignatureType) {
|
|
60936
60948
|
const kind = (_a = signature.declaration) == null ? void 0 : _a.kind;
|
|
60937
60949
|
const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
|
|
60938
|
-
const type = createObjectType(16 /* Anonymous */);
|
|
60950
|
+
const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */));
|
|
60951
|
+
if (signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
60952
|
+
type.symbol.declarations = [signature.declaration];
|
|
60953
|
+
type.symbol.valueDeclaration = signature.declaration;
|
|
60954
|
+
}
|
|
60955
|
+
outerTypeParameters || (outerTypeParameters = signature.declaration && getOuterTypeParameters(
|
|
60956
|
+
signature.declaration,
|
|
60957
|
+
/*includeThisTypes*/
|
|
60958
|
+
true
|
|
60959
|
+
));
|
|
60960
|
+
type.outerTypeParameters = outerTypeParameters;
|
|
60939
60961
|
type.members = emptySymbols;
|
|
60940
60962
|
type.properties = emptyArray;
|
|
60941
60963
|
type.callSignatures = !isConstructor ? [signature] : emptyArray;
|
|
@@ -62102,7 +62124,7 @@ function createTypeChecker(host) {
|
|
|
62102
62124
|
return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
|
|
62103
62125
|
}
|
|
62104
62126
|
function createNormalizedTupleType(target, elementTypes) {
|
|
62105
|
-
var _a, _b, _c;
|
|
62127
|
+
var _a, _b, _c, _d;
|
|
62106
62128
|
if (!(target.combinedFlags & 14 /* NonRequired */)) {
|
|
62107
62129
|
return createTypeReference(target, elementTypes);
|
|
62108
62130
|
}
|
|
@@ -62122,8 +62144,10 @@ function createTypeChecker(host) {
|
|
|
62122
62144
|
const type = elementTypes[i];
|
|
62123
62145
|
const flags = target.elementFlags[i];
|
|
62124
62146
|
if (flags & 8 /* Variadic */) {
|
|
62125
|
-
if (type.flags &
|
|
62126
|
-
addElement(type,
|
|
62147
|
+
if (type.flags & 1 /* Any */) {
|
|
62148
|
+
addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
|
|
62149
|
+
} else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
|
|
62150
|
+
addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
|
|
62127
62151
|
} else if (isTupleType(type)) {
|
|
62128
62152
|
const elements = getElementTypes(type);
|
|
62129
62153
|
if (elements.length + expandedTypes.length >= 1e4) {
|
|
@@ -62138,10 +62162,10 @@ function createTypeChecker(host) {
|
|
|
62138
62162
|
return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
|
|
62139
62163
|
});
|
|
62140
62164
|
} else {
|
|
62141
|
-
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (
|
|
62165
|
+
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
|
|
62142
62166
|
}
|
|
62143
62167
|
} else {
|
|
62144
|
-
addElement(type, flags, (
|
|
62168
|
+
addElement(type, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i]);
|
|
62145
62169
|
}
|
|
62146
62170
|
}
|
|
62147
62171
|
for (let i = 0; i < lastRequiredIndex; i++) {
|
|
@@ -63505,10 +63529,6 @@ function createTypeChecker(host) {
|
|
|
63505
63529
|
}
|
|
63506
63530
|
return type;
|
|
63507
63531
|
}
|
|
63508
|
-
function maybeCloneTypeParameter(p) {
|
|
63509
|
-
const constraint = getConstraintOfTypeParameter(p);
|
|
63510
|
-
return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
|
|
63511
|
-
}
|
|
63512
63532
|
function isSimpleTupleType(node) {
|
|
63513
63533
|
return isTupleTypeNode(node) && length(node.elements) > 0 && !some(node.elements, (e) => isOptionalTypeNode(e) || isRestTypeNode(e) || isNamedTupleMember(e) && !!(e.questionToken || e.dotDotDotToken));
|
|
63514
63534
|
}
|
|
@@ -63538,27 +63558,19 @@ function createTypeChecker(host) {
|
|
|
63538
63558
|
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
|
63539
63559
|
let combinedMapper;
|
|
63540
63560
|
if (root.inferTypeParameters) {
|
|
63541
|
-
const freshParams = sameMap(root.inferTypeParameters, maybeCloneTypeParameter);
|
|
63542
|
-
const freshMapper = freshParams !== root.inferTypeParameters ? createTypeMapper(root.inferTypeParameters, freshParams) : void 0;
|
|
63543
63561
|
const context = createInferenceContext(
|
|
63544
|
-
|
|
63562
|
+
root.inferTypeParameters,
|
|
63545
63563
|
/*signature*/
|
|
63546
63564
|
void 0,
|
|
63547
63565
|
0 /* None */
|
|
63548
63566
|
);
|
|
63549
|
-
if (
|
|
63550
|
-
|
|
63551
|
-
for (let i = 0; i < freshParams.length; i++) {
|
|
63552
|
-
if (freshParams[i] !== root.inferTypeParameters[i]) {
|
|
63553
|
-
freshParams[i].mapper = freshCombinedMapper;
|
|
63554
|
-
}
|
|
63555
|
-
}
|
|
63567
|
+
if (mapper) {
|
|
63568
|
+
context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper);
|
|
63556
63569
|
}
|
|
63557
63570
|
if (!checkTypeDeferred) {
|
|
63558
|
-
inferTypes(context.inferences, checkType,
|
|
63571
|
+
inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
|
|
63559
63572
|
}
|
|
63560
|
-
|
|
63561
|
-
combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
|
|
63573
|
+
combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
|
|
63562
63574
|
}
|
|
63563
63575
|
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
|
63564
63576
|
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
|
@@ -64338,7 +64350,7 @@ function createTypeChecker(host) {
|
|
|
64338
64350
|
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0];
|
|
64339
64351
|
const links = getNodeLinks(declaration);
|
|
64340
64352
|
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
64341
|
-
let typeParameters = links.outerTypeParameters;
|
|
64353
|
+
let typeParameters = type.objectFlags & 134217728 /* SingleSignatureType */ ? type.outerTypeParameters : links.outerTypeParameters;
|
|
64342
64354
|
if (!typeParameters) {
|
|
64343
64355
|
let outerTypeParameters = getOuterTypeParameters(
|
|
64344
64356
|
declaration,
|
|
@@ -64519,6 +64531,9 @@ function createTypeChecker(host) {
|
|
|
64519
64531
|
if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
|
|
64520
64532
|
result.node = type.node;
|
|
64521
64533
|
}
|
|
64534
|
+
if (type.objectFlags & 134217728 /* SingleSignatureType */) {
|
|
64535
|
+
result.outerTypeParameters = type.outerTypeParameters;
|
|
64536
|
+
}
|
|
64522
64537
|
result.target = type;
|
|
64523
64538
|
result.mapper = mapper;
|
|
64524
64539
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -65410,8 +65425,8 @@ function createTypeChecker(host) {
|
|
|
65410
65425
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
65411
65426
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
65412
65427
|
for (let i = 0; i < paramCount; i++) {
|
|
65413
|
-
const sourceType = i === restIndex ?
|
|
65414
|
-
const targetType = i === restIndex ?
|
|
65428
|
+
const sourceType = i === restIndex ? getRestOrAnyTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
|
|
65429
|
+
const targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
65415
65430
|
if (sourceType && targetType) {
|
|
65416
65431
|
const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
65417
65432
|
const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
|
|
@@ -69139,7 +69154,7 @@ function createTypeChecker(host) {
|
|
|
69139
69154
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
69140
69155
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
69141
69156
|
}
|
|
69142
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
69157
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 134217728 /* SingleSignatureType */ && !!length(type.outerTypeParameters) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
69143
69158
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
69144
69159
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
69145
69160
|
}
|
|
@@ -69421,6 +69436,9 @@ function createTypeChecker(host) {
|
|
|
69421
69436
|
pos = p;
|
|
69422
69437
|
}
|
|
69423
69438
|
}
|
|
69439
|
+
function isTupleOfSelf(typeParameter, type) {
|
|
69440
|
+
return isTupleType(type) && getTupleElementType(type, 0) === getIndexedAccessType(typeParameter, getNumberLiteralType(0)) && !getTypeOfPropertyOfType(type, "1");
|
|
69441
|
+
}
|
|
69424
69442
|
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
69425
69443
|
let bivariant = false;
|
|
69426
69444
|
let propagationType;
|
|
@@ -69506,6 +69524,9 @@ function createTypeChecker(host) {
|
|
|
69506
69524
|
inference.priority = priority;
|
|
69507
69525
|
}
|
|
69508
69526
|
if (priority === inference.priority) {
|
|
69527
|
+
if (isTupleOfSelf(inference.typeParameter, candidate)) {
|
|
69528
|
+
return;
|
|
69529
|
+
}
|
|
69509
69530
|
if (contravariant && !bivariant) {
|
|
69510
69531
|
if (!contains(inference.contraCandidates, candidate)) {
|
|
69511
69532
|
inference.contraCandidates = append(inference.contraCandidates, candidate);
|
|
@@ -70072,9 +70093,7 @@ function createTypeChecker(host) {
|
|
|
70072
70093
|
inferredType = silentNeverType;
|
|
70073
70094
|
} else {
|
|
70074
70095
|
const defaultType = getDefaultFromTypeParameter(inference.typeParameter);
|
|
70075
|
-
|
|
70076
|
-
inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
|
|
70077
|
-
}
|
|
70096
|
+
inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
|
|
70078
70097
|
}
|
|
70079
70098
|
} else {
|
|
70080
70099
|
inferredType = getTypeFromInference(inference);
|
|
@@ -76462,7 +76481,7 @@ function createTypeChecker(host) {
|
|
|
76462
76481
|
void 0,
|
|
76463
76482
|
checkMode
|
|
76464
76483
|
);
|
|
76465
|
-
const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
|
|
76484
|
+
const checkArgType = instantiateType(checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType, signature.mapper);
|
|
76466
76485
|
const effectiveCheckArgumentNode = getEffectiveCheckNode(arg);
|
|
76467
76486
|
if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) {
|
|
76468
76487
|
Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors");
|
|
@@ -77006,13 +77025,16 @@ function createTypeChecker(host) {
|
|
|
77006
77025
|
return candidate;
|
|
77007
77026
|
}
|
|
77008
77027
|
for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) {
|
|
77009
|
-
|
|
77028
|
+
let candidate = candidates2[candidateIndex];
|
|
77010
77029
|
if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) {
|
|
77011
77030
|
continue;
|
|
77012
77031
|
}
|
|
77013
77032
|
let checkCandidate;
|
|
77014
77033
|
let inferenceContext;
|
|
77015
77034
|
if (candidate.typeParameters) {
|
|
77035
|
+
if (candidate.declaration && findAncestor(node, (a) => a === candidate.declaration)) {
|
|
77036
|
+
candidate = getImplementationSignature(candidate);
|
|
77037
|
+
}
|
|
77016
77038
|
let typeArgumentTypes;
|
|
77017
77039
|
if (some(typeArguments)) {
|
|
77018
77040
|
typeArgumentTypes = checkTypeArguments(
|
|
@@ -77032,7 +77054,7 @@ function createTypeChecker(host) {
|
|
|
77032
77054
|
/*flags*/
|
|
77033
77055
|
isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */
|
|
77034
77056
|
);
|
|
77035
|
-
typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext);
|
|
77057
|
+
typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext), inferenceContext.nonFixingMapper);
|
|
77036
77058
|
argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */;
|
|
77037
77059
|
}
|
|
77038
77060
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
|
|
@@ -77060,7 +77082,7 @@ function createTypeChecker(host) {
|
|
|
77060
77082
|
if (argCheckMode) {
|
|
77061
77083
|
argCheckMode = 0 /* Normal */;
|
|
77062
77084
|
if (inferenceContext) {
|
|
77063
|
-
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
77085
|
+
const typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext), inferenceContext.mapper);
|
|
77064
77086
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
77065
77087
|
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) {
|
|
77066
77088
|
candidateForArgumentArityError = checkCandidate;
|
|
@@ -78414,6 +78436,11 @@ function createTypeChecker(host) {
|
|
|
78414
78436
|
}
|
|
78415
78437
|
return createTupleType(types, flags, readonly, names);
|
|
78416
78438
|
}
|
|
78439
|
+
function getRestOrAnyTypeAtPosition(source, pos) {
|
|
78440
|
+
const restType = getRestTypeAtPosition(source, pos);
|
|
78441
|
+
const elementType = restType && getElementTypeOfArrayType(restType);
|
|
78442
|
+
return elementType && isTypeAny(elementType) ? anyType : restType;
|
|
78443
|
+
}
|
|
78417
78444
|
function getParameterCount(signature) {
|
|
78418
78445
|
const length2 = signature.parameters.length;
|
|
78419
78446
|
if (signatureHasRestParameter(signature)) {
|
|
@@ -78470,7 +78497,7 @@ function createTypeChecker(host) {
|
|
|
78470
78497
|
if (signatureHasRestParameter(signature)) {
|
|
78471
78498
|
const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
|
|
78472
78499
|
if (!isTupleType(restType)) {
|
|
78473
|
-
return restType;
|
|
78500
|
+
return isTypeAny(restType) ? anyArrayType : restType;
|
|
78474
78501
|
}
|
|
78475
78502
|
if (restType.target.hasRestElement) {
|
|
78476
78503
|
return sliceTupleType(restType, restType.target.fixedLength);
|
|
@@ -80772,7 +80799,7 @@ function createTypeChecker(host) {
|
|
|
80772
80799
|
}
|
|
80773
80800
|
}
|
|
80774
80801
|
}
|
|
80775
|
-
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context));
|
|
80802
|
+
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context), flatMap(inferenceContexts, (c) => c && map(c.inferences, (i) => i.typeParameter)).slice());
|
|
80776
80803
|
}
|
|
80777
80804
|
}
|
|
80778
80805
|
}
|
|
@@ -81774,20 +81801,17 @@ function createTypeChecker(host) {
|
|
|
81774
81801
|
const objectType = type.objectType;
|
|
81775
81802
|
const indexType = type.indexType;
|
|
81776
81803
|
const objectIndexType = isGenericMappedType(objectType) && getMappedTypeNameTypeKind(objectType) === 2 /* Remapping */ ? getIndexTypeForMappedType(objectType, 0 /* None */) : getIndexType(objectType, 0 /* None */);
|
|
81777
|
-
|
|
81804
|
+
const hasNumberIndexInfo = !!getIndexInfoOfType(objectType, numberType);
|
|
81805
|
+
if (everyType(indexType, (t) => isTypeAssignableTo(t, objectIndexType) || hasNumberIndexInfo && isApplicableIndexType(t, numberType))) {
|
|
81778
81806
|
if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
|
|
81779
81807
|
error2(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
|
|
81780
81808
|
}
|
|
81781
81809
|
return type;
|
|
81782
81810
|
}
|
|
81783
|
-
const apparentObjectType = getApparentType(objectType);
|
|
81784
|
-
if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
|
|
81785
|
-
return type;
|
|
81786
|
-
}
|
|
81787
81811
|
if (isGenericObjectType(objectType)) {
|
|
81788
81812
|
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
|
|
81789
81813
|
if (propertyName) {
|
|
81790
|
-
const propertySymbol = forEachType(
|
|
81814
|
+
const propertySymbol = forEachType(getApparentType(objectType), (t) => getPropertyOfType(t, propertyName));
|
|
81791
81815
|
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
81792
81816
|
error2(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
|
|
81793
81817
|
return errorType;
|
|
@@ -135474,6 +135498,17 @@ function fileShouldUseJavaScriptRequire(file, program, host, preferRequire) {
|
|
|
135474
135498
|
}
|
|
135475
135499
|
return preferRequire;
|
|
135476
135500
|
}
|
|
135501
|
+
function isBlockLike(node) {
|
|
135502
|
+
switch (node.kind) {
|
|
135503
|
+
case 241 /* Block */:
|
|
135504
|
+
case 312 /* SourceFile */:
|
|
135505
|
+
case 268 /* ModuleBlock */:
|
|
135506
|
+
case 296 /* CaseClause */:
|
|
135507
|
+
return true;
|
|
135508
|
+
default:
|
|
135509
|
+
return false;
|
|
135510
|
+
}
|
|
135511
|
+
}
|
|
135477
135512
|
|
|
135478
135513
|
// src/services/exportInfoMap.ts
|
|
135479
135514
|
var ImportKind = /* @__PURE__ */ ((ImportKind2) => {
|
|
@@ -140823,6 +140858,14 @@ registerRefactor(refactorNameForMoveToFile, {
|
|
|
140823
140858
|
if (!interactiveRefactorArguments) {
|
|
140824
140859
|
return emptyArray;
|
|
140825
140860
|
}
|
|
140861
|
+
if (context.endPosition !== void 0) {
|
|
140862
|
+
const file = context.file;
|
|
140863
|
+
const startNodeAncestor = findAncestor(getTokenAtPosition(file, context.startPosition), isBlockLike);
|
|
140864
|
+
const endNodeAncestor = findAncestor(getTokenAtPosition(file, context.endPosition), isBlockLike);
|
|
140865
|
+
if (startNodeAncestor && !isSourceFile(startNodeAncestor) && endNodeAncestor && !isSourceFile(endNodeAncestor)) {
|
|
140866
|
+
return emptyArray;
|
|
140867
|
+
}
|
|
140868
|
+
}
|
|
140826
140869
|
if (context.preferences.allowTextChangesInNewFiles && statements) {
|
|
140827
140870
|
return [{ name: refactorNameForMoveToFile, description: description2, actions: [moveToFileAction] }];
|
|
140828
140871
|
}
|
|
@@ -144900,17 +144943,6 @@ function isExtractableExpression(node) {
|
|
|
144900
144943
|
}
|
|
144901
144944
|
return true;
|
|
144902
144945
|
}
|
|
144903
|
-
function isBlockLike(node) {
|
|
144904
|
-
switch (node.kind) {
|
|
144905
|
-
case 241 /* Block */:
|
|
144906
|
-
case 312 /* SourceFile */:
|
|
144907
|
-
case 268 /* ModuleBlock */:
|
|
144908
|
-
case 296 /* CaseClause */:
|
|
144909
|
-
return true;
|
|
144910
|
-
default:
|
|
144911
|
-
return false;
|
|
144912
|
-
}
|
|
144913
|
-
}
|
|
144914
144946
|
function isInJSXContent(node) {
|
|
144915
144947
|
return isStringLiteralJsxAttribute(node) || (isJsxElement(node) || isJsxSelfClosingElement(node) || isJsxFragment(node)) && (isJsxElement(node.parent) || isJsxFragment(node.parent));
|
|
144916
144948
|
}
|
|
@@ -175660,6 +175692,7 @@ __export(ts_exports2, {
|
|
|
175660
175692
|
isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern,
|
|
175661
175693
|
isBindingPattern: () => isBindingPattern,
|
|
175662
175694
|
isBlock: () => isBlock,
|
|
175695
|
+
isBlockLike: () => isBlockLike,
|
|
175663
175696
|
isBlockOrCatchScoped: () => isBlockOrCatchScoped,
|
|
175664
175697
|
isBlockScope: () => isBlockScope,
|
|
175665
175698
|
isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel,
|
|
@@ -190484,6 +190517,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
190484
190517
|
isBindingOrAssignmentPattern,
|
|
190485
190518
|
isBindingPattern,
|
|
190486
190519
|
isBlock,
|
|
190520
|
+
isBlockLike,
|
|
190487
190521
|
isBlockOrCatchScoped,
|
|
190488
190522
|
isBlockScope,
|
|
190489
190523
|
isBlockScopedContainerTopLevel,
|
package/lib/typescript.d.ts
CHANGED
|
@@ -4139,7 +4139,7 @@ declare namespace ts {
|
|
|
4139
4139
|
responseRequired?: boolean;
|
|
4140
4140
|
}
|
|
4141
4141
|
}
|
|
4142
|
-
const versionMajorMinor = "5.
|
|
4142
|
+
const versionMajorMinor = "5.5";
|
|
4143
4143
|
/** The version of the TypeScript compiler release */
|
|
4144
4144
|
const version: string;
|
|
4145
4145
|
/**
|
|
@@ -7242,6 +7242,7 @@ declare namespace ts {
|
|
|
7242
7242
|
ContainsSpread = 2097152,
|
|
7243
7243
|
ObjectRestType = 4194304,
|
|
7244
7244
|
InstantiationExpressionType = 8388608,
|
|
7245
|
+
SingleSignatureType = 134217728,
|
|
7245
7246
|
}
|
|
7246
7247
|
interface ObjectType extends Type {
|
|
7247
7248
|
objectFlags: ObjectFlags;
|
package/lib/typescript.js
CHANGED
|
@@ -34,8 +34,8 @@ var ts = (() => {
|
|
|
34
34
|
var init_corePublic = __esm({
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
|
-
versionMajorMinor = "5.
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
37
|
+
versionMajorMinor = "5.5";
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20240221`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4485,6 +4485,7 @@ ${lanes.join("\n")}
|
|
|
4485
4485
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
4486
4486
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
4487
4487
|
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
|
|
4488
|
+
ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType";
|
|
4488
4489
|
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
|
|
4489
4490
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
|
|
4490
4491
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
|
|
@@ -51273,7 +51274,7 @@ ${lanes.join("\n")}
|
|
|
51273
51274
|
}
|
|
51274
51275
|
const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
|
|
51275
51276
|
if (some(abstractSignatures)) {
|
|
51276
|
-
const types = map(abstractSignatures, getOrCreateTypeFromSignature);
|
|
51277
|
+
const types = map(abstractSignatures, (s) => getOrCreateTypeFromSignature(s));
|
|
51277
51278
|
const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
|
|
51278
51279
|
// the logic in `createTypeNodesFromResolvedType`.
|
|
51279
51280
|
(context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
|
|
@@ -57814,11 +57815,15 @@ ${lanes.join("\n")}
|
|
|
57814
57815
|
return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type));
|
|
57815
57816
|
}
|
|
57816
57817
|
function getResolvedApparentTypeOfMappedType(type) {
|
|
57817
|
-
const
|
|
57818
|
-
|
|
57819
|
-
|
|
57820
|
-
|
|
57821
|
-
|
|
57818
|
+
const target = type.target ?? type;
|
|
57819
|
+
const typeVariable = getHomomorphicTypeVariable(target);
|
|
57820
|
+
if (typeVariable && !target.declaration.nameType) {
|
|
57821
|
+
const constraint = getConstraintTypeFromMappedType(type);
|
|
57822
|
+
if (constraint.flags & 4194304 /* Index */) {
|
|
57823
|
+
const baseConstraint = getBaseConstraintOfType(constraint.type);
|
|
57824
|
+
if (baseConstraint && everyType(baseConstraint, isArrayOrTupleType)) {
|
|
57825
|
+
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
57826
|
+
}
|
|
57822
57827
|
}
|
|
57823
57828
|
}
|
|
57824
57829
|
return type;
|
|
@@ -58663,6 +58668,12 @@ ${lanes.join("\n")}
|
|
|
58663
58668
|
isInJSFile(signature.declaration)
|
|
58664
58669
|
);
|
|
58665
58670
|
}
|
|
58671
|
+
function getImplementationSignature(signature) {
|
|
58672
|
+
return signature.typeParameters ? signature.implementationSignatureCache || (signature.implementationSignatureCache = createImplementationSignature(signature)) : signature;
|
|
58673
|
+
}
|
|
58674
|
+
function createImplementationSignature(signature) {
|
|
58675
|
+
return signature.typeParameters ? instantiateSignature(signature, createTypeMapper([], [])) : signature;
|
|
58676
|
+
}
|
|
58666
58677
|
function getBaseSignature(signature) {
|
|
58667
58678
|
const typeParameters = signature.typeParameters;
|
|
58668
58679
|
if (typeParameters) {
|
|
@@ -58685,12 +58696,22 @@ ${lanes.join("\n")}
|
|
|
58685
58696
|
}
|
|
58686
58697
|
return signature;
|
|
58687
58698
|
}
|
|
58688
|
-
function getOrCreateTypeFromSignature(signature) {
|
|
58699
|
+
function getOrCreateTypeFromSignature(signature, outerTypeParameters) {
|
|
58689
58700
|
var _a;
|
|
58690
58701
|
if (!signature.isolatedSignatureType) {
|
|
58691
58702
|
const kind = (_a = signature.declaration) == null ? void 0 : _a.kind;
|
|
58692
58703
|
const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
|
|
58693
|
-
const type = createObjectType(16 /* Anonymous */);
|
|
58704
|
+
const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */));
|
|
58705
|
+
if (signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
58706
|
+
type.symbol.declarations = [signature.declaration];
|
|
58707
|
+
type.symbol.valueDeclaration = signature.declaration;
|
|
58708
|
+
}
|
|
58709
|
+
outerTypeParameters || (outerTypeParameters = signature.declaration && getOuterTypeParameters(
|
|
58710
|
+
signature.declaration,
|
|
58711
|
+
/*includeThisTypes*/
|
|
58712
|
+
true
|
|
58713
|
+
));
|
|
58714
|
+
type.outerTypeParameters = outerTypeParameters;
|
|
58694
58715
|
type.members = emptySymbols;
|
|
58695
58716
|
type.properties = emptyArray;
|
|
58696
58717
|
type.callSignatures = !isConstructor ? [signature] : emptyArray;
|
|
@@ -59857,7 +59878,7 @@ ${lanes.join("\n")}
|
|
|
59857
59878
|
return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
|
|
59858
59879
|
}
|
|
59859
59880
|
function createNormalizedTupleType(target, elementTypes) {
|
|
59860
|
-
var _a, _b, _c;
|
|
59881
|
+
var _a, _b, _c, _d;
|
|
59861
59882
|
if (!(target.combinedFlags & 14 /* NonRequired */)) {
|
|
59862
59883
|
return createTypeReference(target, elementTypes);
|
|
59863
59884
|
}
|
|
@@ -59877,8 +59898,10 @@ ${lanes.join("\n")}
|
|
|
59877
59898
|
const type = elementTypes[i];
|
|
59878
59899
|
const flags = target.elementFlags[i];
|
|
59879
59900
|
if (flags & 8 /* Variadic */) {
|
|
59880
|
-
if (type.flags &
|
|
59881
|
-
addElement(type,
|
|
59901
|
+
if (type.flags & 1 /* Any */) {
|
|
59902
|
+
addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
|
|
59903
|
+
} else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
|
|
59904
|
+
addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
|
|
59882
59905
|
} else if (isTupleType(type)) {
|
|
59883
59906
|
const elements = getElementTypes(type);
|
|
59884
59907
|
if (elements.length + expandedTypes.length >= 1e4) {
|
|
@@ -59893,10 +59916,10 @@ ${lanes.join("\n")}
|
|
|
59893
59916
|
return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
|
|
59894
59917
|
});
|
|
59895
59918
|
} else {
|
|
59896
|
-
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (
|
|
59919
|
+
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
|
|
59897
59920
|
}
|
|
59898
59921
|
} else {
|
|
59899
|
-
addElement(type, flags, (
|
|
59922
|
+
addElement(type, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i]);
|
|
59900
59923
|
}
|
|
59901
59924
|
}
|
|
59902
59925
|
for (let i = 0; i < lastRequiredIndex; i++) {
|
|
@@ -61260,10 +61283,6 @@ ${lanes.join("\n")}
|
|
|
61260
61283
|
}
|
|
61261
61284
|
return type;
|
|
61262
61285
|
}
|
|
61263
|
-
function maybeCloneTypeParameter(p) {
|
|
61264
|
-
const constraint = getConstraintOfTypeParameter(p);
|
|
61265
|
-
return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
|
|
61266
|
-
}
|
|
61267
61286
|
function isSimpleTupleType(node) {
|
|
61268
61287
|
return isTupleTypeNode(node) && length(node.elements) > 0 && !some(node.elements, (e) => isOptionalTypeNode(e) || isRestTypeNode(e) || isNamedTupleMember(e) && !!(e.questionToken || e.dotDotDotToken));
|
|
61269
61288
|
}
|
|
@@ -61293,27 +61312,19 @@ ${lanes.join("\n")}
|
|
|
61293
61312
|
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
|
61294
61313
|
let combinedMapper;
|
|
61295
61314
|
if (root.inferTypeParameters) {
|
|
61296
|
-
const freshParams = sameMap(root.inferTypeParameters, maybeCloneTypeParameter);
|
|
61297
|
-
const freshMapper = freshParams !== root.inferTypeParameters ? createTypeMapper(root.inferTypeParameters, freshParams) : void 0;
|
|
61298
61315
|
const context = createInferenceContext(
|
|
61299
|
-
|
|
61316
|
+
root.inferTypeParameters,
|
|
61300
61317
|
/*signature*/
|
|
61301
61318
|
void 0,
|
|
61302
61319
|
0 /* None */
|
|
61303
61320
|
);
|
|
61304
|
-
if (
|
|
61305
|
-
|
|
61306
|
-
for (let i = 0; i < freshParams.length; i++) {
|
|
61307
|
-
if (freshParams[i] !== root.inferTypeParameters[i]) {
|
|
61308
|
-
freshParams[i].mapper = freshCombinedMapper;
|
|
61309
|
-
}
|
|
61310
|
-
}
|
|
61321
|
+
if (mapper) {
|
|
61322
|
+
context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper);
|
|
61311
61323
|
}
|
|
61312
61324
|
if (!checkTypeDeferred) {
|
|
61313
|
-
inferTypes(context.inferences, checkType,
|
|
61325
|
+
inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
|
|
61314
61326
|
}
|
|
61315
|
-
|
|
61316
|
-
combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
|
|
61327
|
+
combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
|
|
61317
61328
|
}
|
|
61318
61329
|
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
|
61319
61330
|
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
|
@@ -62093,7 +62104,7 @@ ${lanes.join("\n")}
|
|
|
62093
62104
|
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0];
|
|
62094
62105
|
const links = getNodeLinks(declaration);
|
|
62095
62106
|
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
62096
|
-
let typeParameters = links.outerTypeParameters;
|
|
62107
|
+
let typeParameters = type.objectFlags & 134217728 /* SingleSignatureType */ ? type.outerTypeParameters : links.outerTypeParameters;
|
|
62097
62108
|
if (!typeParameters) {
|
|
62098
62109
|
let outerTypeParameters = getOuterTypeParameters(
|
|
62099
62110
|
declaration,
|
|
@@ -62274,6 +62285,9 @@ ${lanes.join("\n")}
|
|
|
62274
62285
|
if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
|
|
62275
62286
|
result.node = type.node;
|
|
62276
62287
|
}
|
|
62288
|
+
if (type.objectFlags & 134217728 /* SingleSignatureType */) {
|
|
62289
|
+
result.outerTypeParameters = type.outerTypeParameters;
|
|
62290
|
+
}
|
|
62277
62291
|
result.target = type;
|
|
62278
62292
|
result.mapper = mapper;
|
|
62279
62293
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -63165,8 +63179,8 @@ ${lanes.join("\n")}
|
|
|
63165
63179
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
63166
63180
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
63167
63181
|
for (let i = 0; i < paramCount; i++) {
|
|
63168
|
-
const sourceType = i === restIndex ?
|
|
63169
|
-
const targetType = i === restIndex ?
|
|
63182
|
+
const sourceType = i === restIndex ? getRestOrAnyTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
|
|
63183
|
+
const targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
63170
63184
|
if (sourceType && targetType) {
|
|
63171
63185
|
const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
63172
63186
|
const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
|
|
@@ -66894,7 +66908,7 @@ ${lanes.join("\n")}
|
|
|
66894
66908
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
66895
66909
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
66896
66910
|
}
|
|
66897
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
66911
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 134217728 /* SingleSignatureType */ && !!length(type.outerTypeParameters) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
66898
66912
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
66899
66913
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
66900
66914
|
}
|
|
@@ -67176,6 +67190,9 @@ ${lanes.join("\n")}
|
|
|
67176
67190
|
pos = p;
|
|
67177
67191
|
}
|
|
67178
67192
|
}
|
|
67193
|
+
function isTupleOfSelf(typeParameter, type) {
|
|
67194
|
+
return isTupleType(type) && getTupleElementType(type, 0) === getIndexedAccessType(typeParameter, getNumberLiteralType(0)) && !getTypeOfPropertyOfType(type, "1");
|
|
67195
|
+
}
|
|
67179
67196
|
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
67180
67197
|
let bivariant = false;
|
|
67181
67198
|
let propagationType;
|
|
@@ -67261,6 +67278,9 @@ ${lanes.join("\n")}
|
|
|
67261
67278
|
inference.priority = priority;
|
|
67262
67279
|
}
|
|
67263
67280
|
if (priority === inference.priority) {
|
|
67281
|
+
if (isTupleOfSelf(inference.typeParameter, candidate)) {
|
|
67282
|
+
return;
|
|
67283
|
+
}
|
|
67264
67284
|
if (contravariant && !bivariant) {
|
|
67265
67285
|
if (!contains(inference.contraCandidates, candidate)) {
|
|
67266
67286
|
inference.contraCandidates = append(inference.contraCandidates, candidate);
|
|
@@ -67827,9 +67847,7 @@ ${lanes.join("\n")}
|
|
|
67827
67847
|
inferredType = silentNeverType;
|
|
67828
67848
|
} else {
|
|
67829
67849
|
const defaultType = getDefaultFromTypeParameter(inference.typeParameter);
|
|
67830
|
-
|
|
67831
|
-
inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
|
|
67832
|
-
}
|
|
67850
|
+
inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
|
|
67833
67851
|
}
|
|
67834
67852
|
} else {
|
|
67835
67853
|
inferredType = getTypeFromInference(inference);
|
|
@@ -74217,7 +74235,7 @@ ${lanes.join("\n")}
|
|
|
74217
74235
|
void 0,
|
|
74218
74236
|
checkMode
|
|
74219
74237
|
);
|
|
74220
|
-
const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
|
|
74238
|
+
const checkArgType = instantiateType(checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType, signature.mapper);
|
|
74221
74239
|
const effectiveCheckArgumentNode = getEffectiveCheckNode(arg);
|
|
74222
74240
|
if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) {
|
|
74223
74241
|
Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors");
|
|
@@ -74761,13 +74779,16 @@ ${lanes.join("\n")}
|
|
|
74761
74779
|
return candidate;
|
|
74762
74780
|
}
|
|
74763
74781
|
for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) {
|
|
74764
|
-
|
|
74782
|
+
let candidate = candidates2[candidateIndex];
|
|
74765
74783
|
if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) {
|
|
74766
74784
|
continue;
|
|
74767
74785
|
}
|
|
74768
74786
|
let checkCandidate;
|
|
74769
74787
|
let inferenceContext;
|
|
74770
74788
|
if (candidate.typeParameters) {
|
|
74789
|
+
if (candidate.declaration && findAncestor(node, (a) => a === candidate.declaration)) {
|
|
74790
|
+
candidate = getImplementationSignature(candidate);
|
|
74791
|
+
}
|
|
74771
74792
|
let typeArgumentTypes;
|
|
74772
74793
|
if (some(typeArguments)) {
|
|
74773
74794
|
typeArgumentTypes = checkTypeArguments(
|
|
@@ -74787,7 +74808,7 @@ ${lanes.join("\n")}
|
|
|
74787
74808
|
/*flags*/
|
|
74788
74809
|
isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */
|
|
74789
74810
|
);
|
|
74790
|
-
typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext);
|
|
74811
|
+
typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext), inferenceContext.nonFixingMapper);
|
|
74791
74812
|
argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */;
|
|
74792
74813
|
}
|
|
74793
74814
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
|
|
@@ -74815,7 +74836,7 @@ ${lanes.join("\n")}
|
|
|
74815
74836
|
if (argCheckMode) {
|
|
74816
74837
|
argCheckMode = 0 /* Normal */;
|
|
74817
74838
|
if (inferenceContext) {
|
|
74818
|
-
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
74839
|
+
const typeArgumentTypes = instantiateTypes(inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext), inferenceContext.mapper);
|
|
74819
74840
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
74820
74841
|
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) {
|
|
74821
74842
|
candidateForArgumentArityError = checkCandidate;
|
|
@@ -76169,6 +76190,11 @@ ${lanes.join("\n")}
|
|
|
76169
76190
|
}
|
|
76170
76191
|
return createTupleType(types, flags, readonly, names);
|
|
76171
76192
|
}
|
|
76193
|
+
function getRestOrAnyTypeAtPosition(source, pos) {
|
|
76194
|
+
const restType = getRestTypeAtPosition(source, pos);
|
|
76195
|
+
const elementType = restType && getElementTypeOfArrayType(restType);
|
|
76196
|
+
return elementType && isTypeAny(elementType) ? anyType : restType;
|
|
76197
|
+
}
|
|
76172
76198
|
function getParameterCount(signature) {
|
|
76173
76199
|
const length2 = signature.parameters.length;
|
|
76174
76200
|
if (signatureHasRestParameter(signature)) {
|
|
@@ -76225,7 +76251,7 @@ ${lanes.join("\n")}
|
|
|
76225
76251
|
if (signatureHasRestParameter(signature)) {
|
|
76226
76252
|
const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
|
|
76227
76253
|
if (!isTupleType(restType)) {
|
|
76228
|
-
return restType;
|
|
76254
|
+
return isTypeAny(restType) ? anyArrayType : restType;
|
|
76229
76255
|
}
|
|
76230
76256
|
if (restType.target.hasRestElement) {
|
|
76231
76257
|
return sliceTupleType(restType, restType.target.fixedLength);
|
|
@@ -78527,7 +78553,7 @@ ${lanes.join("\n")}
|
|
|
78527
78553
|
}
|
|
78528
78554
|
}
|
|
78529
78555
|
}
|
|
78530
|
-
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context));
|
|
78556
|
+
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context), flatMap(inferenceContexts, (c) => c && map(c.inferences, (i) => i.typeParameter)).slice());
|
|
78531
78557
|
}
|
|
78532
78558
|
}
|
|
78533
78559
|
}
|
|
@@ -79529,20 +79555,17 @@ ${lanes.join("\n")}
|
|
|
79529
79555
|
const objectType = type.objectType;
|
|
79530
79556
|
const indexType = type.indexType;
|
|
79531
79557
|
const objectIndexType = isGenericMappedType(objectType) && getMappedTypeNameTypeKind(objectType) === 2 /* Remapping */ ? getIndexTypeForMappedType(objectType, 0 /* None */) : getIndexType(objectType, 0 /* None */);
|
|
79532
|
-
|
|
79558
|
+
const hasNumberIndexInfo = !!getIndexInfoOfType(objectType, numberType);
|
|
79559
|
+
if (everyType(indexType, (t) => isTypeAssignableTo(t, objectIndexType) || hasNumberIndexInfo && isApplicableIndexType(t, numberType))) {
|
|
79533
79560
|
if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
|
|
79534
79561
|
error2(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
|
|
79535
79562
|
}
|
|
79536
79563
|
return type;
|
|
79537
79564
|
}
|
|
79538
|
-
const apparentObjectType = getApparentType(objectType);
|
|
79539
|
-
if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
|
|
79540
|
-
return type;
|
|
79541
|
-
}
|
|
79542
79565
|
if (isGenericObjectType(objectType)) {
|
|
79543
79566
|
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
|
|
79544
79567
|
if (propertyName) {
|
|
79545
|
-
const propertySymbol = forEachType(
|
|
79568
|
+
const propertySymbol = forEachType(getApparentType(objectType), (t) => getPropertyOfType(t, propertyName));
|
|
79546
79569
|
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
79547
79570
|
error2(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
|
|
79548
79571
|
return errorType;
|
|
@@ -133721,6 +133744,17 @@ ${lanes.join("\n")}
|
|
|
133721
133744
|
}
|
|
133722
133745
|
return preferRequire;
|
|
133723
133746
|
}
|
|
133747
|
+
function isBlockLike(node) {
|
|
133748
|
+
switch (node.kind) {
|
|
133749
|
+
case 241 /* Block */:
|
|
133750
|
+
case 312 /* SourceFile */:
|
|
133751
|
+
case 268 /* ModuleBlock */:
|
|
133752
|
+
case 296 /* CaseClause */:
|
|
133753
|
+
return true;
|
|
133754
|
+
default:
|
|
133755
|
+
return false;
|
|
133756
|
+
}
|
|
133757
|
+
}
|
|
133724
133758
|
var scanner, SemanticMeaning, tripleSlashDirectivePrefixRegex, typeKeywords, QuotePreference, displayPartWriter, lineFeed2, ANONYMOUS, syntaxMayBeASICandidate;
|
|
133725
133759
|
var init_utilities4 = __esm({
|
|
133726
133760
|
"src/services/utilities.ts"() {
|
|
@@ -140166,6 +140200,14 @@ ${lanes.join("\n")}
|
|
|
140166
140200
|
if (!interactiveRefactorArguments) {
|
|
140167
140201
|
return emptyArray;
|
|
140168
140202
|
}
|
|
140203
|
+
if (context.endPosition !== void 0) {
|
|
140204
|
+
const file = context.file;
|
|
140205
|
+
const startNodeAncestor = findAncestor(getTokenAtPosition(file, context.startPosition), isBlockLike);
|
|
140206
|
+
const endNodeAncestor = findAncestor(getTokenAtPosition(file, context.endPosition), isBlockLike);
|
|
140207
|
+
if (startNodeAncestor && !isSourceFile(startNodeAncestor) && endNodeAncestor && !isSourceFile(endNodeAncestor)) {
|
|
140208
|
+
return emptyArray;
|
|
140209
|
+
}
|
|
140210
|
+
}
|
|
140169
140211
|
if (context.preferences.allowTextChangesInNewFiles && statements) {
|
|
140170
140212
|
return [{ name: refactorNameForMoveToFile, description: description2, actions: [moveToFileAction] }];
|
|
140171
140213
|
}
|
|
@@ -143325,17 +143367,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
143325
143367
|
}
|
|
143326
143368
|
return true;
|
|
143327
143369
|
}
|
|
143328
|
-
function isBlockLike(node) {
|
|
143329
|
-
switch (node.kind) {
|
|
143330
|
-
case 241 /* Block */:
|
|
143331
|
-
case 312 /* SourceFile */:
|
|
143332
|
-
case 268 /* ModuleBlock */:
|
|
143333
|
-
case 296 /* CaseClause */:
|
|
143334
|
-
return true;
|
|
143335
|
-
default:
|
|
143336
|
-
return false;
|
|
143337
|
-
}
|
|
143338
|
-
}
|
|
143339
143370
|
function isInJSXContent(node) {
|
|
143340
143371
|
return isStringLiteralJsxAttribute(node) || (isJsxElement(node) || isJsxSelfClosingElement(node) || isJsxFragment(node)) && (isJsxElement(node.parent) || isJsxFragment(node.parent));
|
|
143341
143372
|
}
|
|
@@ -187246,6 +187277,7 @@ ${e.message}`;
|
|
|
187246
187277
|
isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern,
|
|
187247
187278
|
isBindingPattern: () => isBindingPattern,
|
|
187248
187279
|
isBlock: () => isBlock,
|
|
187280
|
+
isBlockLike: () => isBlockLike,
|
|
187249
187281
|
isBlockOrCatchScoped: () => isBlockOrCatchScoped,
|
|
187250
187282
|
isBlockScope: () => isBlockScope,
|
|
187251
187283
|
isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel,
|
|
@@ -189667,6 +189699,7 @@ ${e.message}`;
|
|
|
189667
189699
|
isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern,
|
|
189668
189700
|
isBindingPattern: () => isBindingPattern,
|
|
189669
189701
|
isBlock: () => isBlock,
|
|
189702
|
+
isBlockLike: () => isBlockLike,
|
|
189670
189703
|
isBlockOrCatchScoped: () => isBlockOrCatchScoped,
|
|
189671
189704
|
isBlockScope: () => isBlockScope,
|
|
189672
189705
|
isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel,
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -53,8 +53,8 @@ var fs = __toESM(require("fs"));
|
|
|
53
53
|
var path = __toESM(require("path"));
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
|
-
var versionMajorMinor = "5.
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
56
|
+
var versionMajorMinor = "5.5";
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20240221`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -3142,6 +3142,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
3142
3142
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
3143
3143
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
3144
3144
|
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
|
|
3145
|
+
ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType";
|
|
3145
3146
|
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
|
|
3146
3147
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
|
|
3147
3148
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
|
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": "5.
|
|
5
|
+
"version": "5.5.0-pr-57403-12",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "70338f99ff0955fde9fe29b360c4bd685ac8d868"
|
|
118
118
|
}
|