typescript 5.0.0-dev.20230213 → 5.0.0-dev.20230215
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 +155 -96
- package/lib/tsserver.js +174 -106
- package/lib/tsserverlibrary.d.ts +8 -5
- package/lib/tsserverlibrary.js +174 -106
- package/lib/typescript.d.ts +8 -5
- package/lib/typescript.js +174 -106
- package/lib/typingsInstaller.js +10 -5
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.0";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230215`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4477,13 +4477,14 @@ ${lanes.join("\n")}
|
|
|
4477
4477
|
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
|
|
4478
4478
|
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
|
|
4479
4479
|
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
|
|
4480
|
-
TypeFlags2[TypeFlags2["Unit"] =
|
|
4480
|
+
TypeFlags2[TypeFlags2["Unit"] = 109472] = "Unit";
|
|
4481
|
+
TypeFlags2[TypeFlags2["Freshable"] = 2976] = "Freshable";
|
|
4481
4482
|
TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral";
|
|
4482
4483
|
TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique";
|
|
4483
4484
|
TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy";
|
|
4484
4485
|
TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy";
|
|
4485
4486
|
TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic";
|
|
4486
|
-
TypeFlags2[TypeFlags2["Primitive"] =
|
|
4487
|
+
TypeFlags2[TypeFlags2["Primitive"] = 134348796] = "Primitive";
|
|
4487
4488
|
TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike";
|
|
4488
4489
|
TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike";
|
|
4489
4490
|
TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike";
|
|
@@ -13673,7 +13674,7 @@ ${lanes.join("\n")}
|
|
|
13673
13674
|
return kind === 1 /* CommonJS */ || kind === 100 /* Node16 */ || kind === 199 /* NodeNext */;
|
|
13674
13675
|
}
|
|
13675
13676
|
function isEffectiveExternalModule(node, compilerOptions) {
|
|
13676
|
-
return isExternalModule(node) || compilerOptions
|
|
13677
|
+
return isExternalModule(node) || getIsolatedModules(compilerOptions) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator;
|
|
13677
13678
|
}
|
|
13678
13679
|
function isEffectiveStrictModeSourceFile(node, compilerOptions) {
|
|
13679
13680
|
switch (node.scriptKind) {
|
|
@@ -13694,7 +13695,7 @@ ${lanes.join("\n")}
|
|
|
13694
13695
|
if (startsWithUseStrict(node.statements)) {
|
|
13695
13696
|
return true;
|
|
13696
13697
|
}
|
|
13697
|
-
if (isExternalModule(node) || compilerOptions
|
|
13698
|
+
if (isExternalModule(node) || getIsolatedModules(compilerOptions)) {
|
|
13698
13699
|
if (getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */) {
|
|
13699
13700
|
return true;
|
|
13700
13701
|
}
|
|
@@ -18026,7 +18027,7 @@ ${lanes.join("\n")}
|
|
|
18026
18027
|
return !!(compilerOptions.declaration || compilerOptions.composite);
|
|
18027
18028
|
}
|
|
18028
18029
|
function shouldPreserveConstEnums(compilerOptions) {
|
|
18029
|
-
return !!(compilerOptions.preserveConstEnums || compilerOptions
|
|
18030
|
+
return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions));
|
|
18030
18031
|
}
|
|
18031
18032
|
function isIncrementalCompilation(options) {
|
|
18032
18033
|
return !!(options.incremental || options.composite);
|
|
@@ -45179,15 +45180,14 @@ ${lanes.join("\n")}
|
|
|
45179
45180
|
getTypeOfPropertyOfContextualType,
|
|
45180
45181
|
getFullyQualifiedName,
|
|
45181
45182
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
45182
|
-
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => getResolvedSignatureWorker(
|
|
45183
|
+
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
45183
45184
|
call,
|
|
45184
45185
|
candidatesOutArray,
|
|
45185
45186
|
/*argumentCount*/
|
|
45186
45187
|
void 0,
|
|
45187
|
-
32 /* IsForStringLiteralArgumentCompletions
|
|
45188
|
-
|
|
45189
|
-
),
|
|
45190
|
-
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */),
|
|
45188
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
45189
|
+
)),
|
|
45190
|
+
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
45191
45191
|
getExpandedParameters,
|
|
45192
45192
|
hasEffectiveRestParameter,
|
|
45193
45193
|
containsArgumentsReference,
|
|
@@ -45381,32 +45381,41 @@ ${lanes.join("\n")}
|
|
|
45381
45381
|
getMemberOverrideModifierStatus,
|
|
45382
45382
|
isTypeParameterPossiblyReferenced
|
|
45383
45383
|
};
|
|
45384
|
-
function
|
|
45384
|
+
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
45385
45385
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
45386
45386
|
const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
|
|
45387
|
+
if (containingCall) {
|
|
45388
|
+
getNodeLinks(containingCall).resolvedSignature = void 0;
|
|
45389
|
+
}
|
|
45390
|
+
const result = fn();
|
|
45391
|
+
if (containingCall) {
|
|
45392
|
+
getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
|
|
45393
|
+
}
|
|
45394
|
+
return result;
|
|
45395
|
+
}
|
|
45396
|
+
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
45397
|
+
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
45387
45398
|
if (containingCall) {
|
|
45388
45399
|
let toMarkSkip = node;
|
|
45389
45400
|
do {
|
|
45390
45401
|
getNodeLinks(toMarkSkip).skipDirectInference = true;
|
|
45391
45402
|
toMarkSkip = toMarkSkip.parent;
|
|
45392
45403
|
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
45393
|
-
getNodeLinks(containingCall).resolvedSignature = void 0;
|
|
45394
45404
|
}
|
|
45395
|
-
const result = fn
|
|
45405
|
+
const result = runWithoutResolvedSignatureCaching(node, fn);
|
|
45396
45406
|
if (containingCall) {
|
|
45397
45407
|
let toMarkSkip = node;
|
|
45398
45408
|
do {
|
|
45399
45409
|
getNodeLinks(toMarkSkip).skipDirectInference = void 0;
|
|
45400
45410
|
toMarkSkip = toMarkSkip.parent;
|
|
45401
45411
|
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
45402
|
-
getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
|
|
45403
45412
|
}
|
|
45404
45413
|
return result;
|
|
45405
45414
|
}
|
|
45406
|
-
function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode
|
|
45415
|
+
function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) {
|
|
45407
45416
|
const node = getParseTreeNode(nodeIn, isCallLikeExpression);
|
|
45408
45417
|
apparentArgumentCount = argumentCount;
|
|
45409
|
-
const res = !node ? void 0 :
|
|
45418
|
+
const res = !node ? void 0 : getResolvedSignature(node, candidatesOutArray, checkMode);
|
|
45410
45419
|
apparentArgumentCount = void 0;
|
|
45411
45420
|
return res;
|
|
45412
45421
|
}
|
|
@@ -48368,7 +48377,7 @@ ${lanes.join("\n")}
|
|
|
48368
48377
|
return shouldTreatPropertiesOfExternalModuleAsExports(type) ? getPropertyOfType(type, memberName) : void 0;
|
|
48369
48378
|
}
|
|
48370
48379
|
function shouldTreatPropertiesOfExternalModuleAsExports(resolvedExternalModuleType) {
|
|
48371
|
-
return !(resolvedExternalModuleType.flags &
|
|
48380
|
+
return !(resolvedExternalModuleType.flags & 134348796 /* Primitive */ || getObjectFlags(resolvedExternalModuleType) & 1 /* Class */ || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path
|
|
48372
48381
|
isArrayType(resolvedExternalModuleType) || isTupleType(resolvedExternalModuleType));
|
|
48373
48382
|
}
|
|
48374
48383
|
function getExportsOfSymbol(symbol) {
|
|
@@ -52567,8 +52576,8 @@ ${lanes.join("\n")}
|
|
|
52567
52576
|
const t = types[i];
|
|
52568
52577
|
flags |= t.flags;
|
|
52569
52578
|
if (!(t.flags & 98304 /* Nullable */)) {
|
|
52570
|
-
if (t.flags & (512 /* BooleanLiteral */ |
|
|
52571
|
-
const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType :
|
|
52579
|
+
if (t.flags & (512 /* BooleanLiteral */ | 1056 /* EnumLike */)) {
|
|
52580
|
+
const baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLikeType(t);
|
|
52572
52581
|
if (baseType.flags & 1048576 /* Union */) {
|
|
52573
52582
|
const count = baseType.types.length;
|
|
52574
52583
|
if (i + count <= types.length && getRegularTypeOfLiteralType(types[i + count - 1]) === getRegularTypeOfLiteralType(baseType.types[count - 1])) {
|
|
@@ -52852,6 +52861,8 @@ ${lanes.join("\n")}
|
|
|
52852
52861
|
return !!target.baseTypesResolved;
|
|
52853
52862
|
case 8 /* WriteType */:
|
|
52854
52863
|
return !!getSymbolLinks(target).writeType;
|
|
52864
|
+
case 9 /* ParameterInitializerContainsUndefined */:
|
|
52865
|
+
return getNodeLinks(target).parameterInitializerContainsUndefined !== void 0;
|
|
52855
52866
|
}
|
|
52856
52867
|
return Debug.assertNever(propertyName);
|
|
52857
52868
|
}
|
|
@@ -54443,8 +54454,8 @@ ${lanes.join("\n")}
|
|
|
54443
54454
|
}
|
|
54444
54455
|
return links.declaredType;
|
|
54445
54456
|
}
|
|
54446
|
-
function
|
|
54447
|
-
return type.flags &
|
|
54457
|
+
function getBaseTypeOfEnumLikeType(type) {
|
|
54458
|
+
return type.flags & 1056 /* EnumLike */ && type.symbol.flags & 8 /* EnumMember */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type;
|
|
54448
54459
|
}
|
|
54449
54460
|
function getDeclaredTypeOfEnum(symbol) {
|
|
54450
54461
|
const links = getSymbolLinks(symbol);
|
|
@@ -54457,7 +54468,7 @@ ${lanes.join("\n")}
|
|
|
54457
54468
|
if (hasBindableName(member)) {
|
|
54458
54469
|
const memberSymbol = getSymbolOfDeclaration(member);
|
|
54459
54470
|
const value = getEnumMemberValue(member);
|
|
54460
|
-
const memberType = value !== void 0 ?
|
|
54471
|
+
const memberType = getFreshTypeOfLiteralType(value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol));
|
|
54461
54472
|
getSymbolLinks(memberSymbol).declaredType = memberType;
|
|
54462
54473
|
memberTypeList.push(getRegularTypeOfLiteralType(memberType));
|
|
54463
54474
|
}
|
|
@@ -54471,7 +54482,7 @@ ${lanes.join("\n")}
|
|
|
54471
54482
|
symbol,
|
|
54472
54483
|
/*aliasTypeArguments*/
|
|
54473
54484
|
void 0
|
|
54474
|
-
) :
|
|
54485
|
+
) : createComputedEnumType(symbol);
|
|
54475
54486
|
if (enumType.flags & 1048576 /* Union */) {
|
|
54476
54487
|
enumType.flags |= 1024 /* EnumLiteral */;
|
|
54477
54488
|
enumType.symbol = symbol;
|
|
@@ -54480,6 +54491,15 @@ ${lanes.join("\n")}
|
|
|
54480
54491
|
}
|
|
54481
54492
|
return links.declaredType;
|
|
54482
54493
|
}
|
|
54494
|
+
function createComputedEnumType(symbol) {
|
|
54495
|
+
const regularType = createTypeWithSymbol(32 /* Enum */, symbol);
|
|
54496
|
+
const freshType = createTypeWithSymbol(32 /* Enum */, symbol);
|
|
54497
|
+
regularType.regularType = regularType;
|
|
54498
|
+
regularType.freshType = freshType;
|
|
54499
|
+
freshType.regularType = regularType;
|
|
54500
|
+
freshType.freshType = freshType;
|
|
54501
|
+
return regularType;
|
|
54502
|
+
}
|
|
54483
54503
|
function getDeclaredTypeOfEnumMember(symbol) {
|
|
54484
54504
|
const links = getSymbolLinks(symbol);
|
|
54485
54505
|
if (!links.declaredType) {
|
|
@@ -58168,7 +58188,7 @@ ${lanes.join("\n")}
|
|
|
58168
58188
|
orderedRemoveItemAt(typeSet, 1);
|
|
58169
58189
|
}
|
|
58170
58190
|
}
|
|
58171
|
-
if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
58191
|
+
if (includes & (32 /* Enum */ | 2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
58172
58192
|
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
|
|
58173
58193
|
}
|
|
58174
58194
|
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
|
|
@@ -58299,7 +58319,7 @@ ${lanes.join("\n")}
|
|
|
58299
58319
|
type = undefinedType;
|
|
58300
58320
|
}
|
|
58301
58321
|
if (!typeSet.has(type.id.toString())) {
|
|
58302
|
-
if (type.flags &
|
|
58322
|
+
if (type.flags & 109472 /* Unit */ && includes & 109472 /* Unit */) {
|
|
58303
58323
|
includes |= 67108864 /* NonPrimitive */;
|
|
58304
58324
|
}
|
|
58305
58325
|
typeSet.set(type.id.toString(), type);
|
|
@@ -58575,7 +58595,7 @@ ${lanes.join("\n")}
|
|
|
58575
58595
|
const typeVariable = getTypeParameterFromMappedType(mappedType);
|
|
58576
58596
|
return isDistributive(getNameTypeFromMappedType(mappedType) || typeVariable);
|
|
58577
58597
|
function isDistributive(type) {
|
|
58578
|
-
return type.flags & (3 /* AnyOrUnknown */ |
|
|
58598
|
+
return type.flags & (3 /* AnyOrUnknown */ | 134348796 /* Primitive */ | 131072 /* Never */ | 262144 /* TypeParameter */ | 524288 /* Object */ | 67108864 /* NonPrimitive */) ? true : type.flags & 16777216 /* Conditional */ ? type.root.isDistributive && type.checkType === typeVariable : type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) ? every(type.types, isDistributive) : type.flags & 8388608 /* IndexedAccess */ ? isDistributive(type.objectType) && isDistributive(type.indexType) : type.flags & 33554432 /* Substitution */ ? isDistributive(type.baseType) && isDistributive(type.constraint) : type.flags & 268435456 /* StringMapping */ ? isDistributive(type.type) : false;
|
|
58579
58599
|
}
|
|
58580
58600
|
}
|
|
58581
58601
|
function getLiteralTypeFromPropertyName(name) {
|
|
@@ -59672,7 +59692,7 @@ ${lanes.join("\n")}
|
|
|
59672
59692
|
return type;
|
|
59673
59693
|
}
|
|
59674
59694
|
function getFreshTypeOfLiteralType(type) {
|
|
59675
|
-
if (type.flags &
|
|
59695
|
+
if (type.flags & 2976 /* Freshable */) {
|
|
59676
59696
|
if (!type.freshType) {
|
|
59677
59697
|
const freshType = createLiteralType(type.flags, type.value, type.symbol, type);
|
|
59678
59698
|
freshType.freshType = freshType;
|
|
@@ -59683,10 +59703,10 @@ ${lanes.join("\n")}
|
|
|
59683
59703
|
return type;
|
|
59684
59704
|
}
|
|
59685
59705
|
function getRegularTypeOfLiteralType(type) {
|
|
59686
|
-
return type.flags &
|
|
59706
|
+
return type.flags & 2976 /* Freshable */ ? type.regularType : type.flags & 1048576 /* Union */ ? type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType)) : type;
|
|
59687
59707
|
}
|
|
59688
59708
|
function isFreshLiteralType(type) {
|
|
59689
|
-
return !!(type.flags &
|
|
59709
|
+
return !!(type.flags & 2976 /* Freshable */) && type.freshType === type;
|
|
59690
59710
|
}
|
|
59691
59711
|
function getStringLiteralType(value) {
|
|
59692
59712
|
let type;
|
|
@@ -60365,13 +60385,13 @@ ${lanes.join("\n")}
|
|
|
60365
60385
|
return type;
|
|
60366
60386
|
}
|
|
60367
60387
|
function getUniqueLiteralFilledInstantiation(type) {
|
|
60368
|
-
return type.flags & (
|
|
60388
|
+
return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
60369
60389
|
}
|
|
60370
60390
|
function getPermissiveInstantiation(type) {
|
|
60371
|
-
return type.flags & (
|
|
60391
|
+
return type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
|
|
60372
60392
|
}
|
|
60373
60393
|
function getRestrictiveInstantiation(type) {
|
|
60374
|
-
if (type.flags & (
|
|
60394
|
+
if (type.flags & (134348796 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) {
|
|
60375
60395
|
return type;
|
|
60376
60396
|
}
|
|
60377
60397
|
if (type.restrictiveInstantiation) {
|
|
@@ -60951,7 +60971,7 @@ ${lanes.join("\n")}
|
|
|
60951
60971
|
}
|
|
60952
60972
|
}
|
|
60953
60973
|
function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) {
|
|
60954
|
-
if (target.flags & (
|
|
60974
|
+
if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */))
|
|
60955
60975
|
return false;
|
|
60956
60976
|
if (isTupleLikeType(source)) {
|
|
60957
60977
|
return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer);
|
|
@@ -61000,7 +61020,7 @@ ${lanes.join("\n")}
|
|
|
61000
61020
|
}
|
|
61001
61021
|
}
|
|
61002
61022
|
function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) {
|
|
61003
|
-
if (target.flags & (
|
|
61023
|
+
if (target.flags & (134348796 /* Primitive */ | 131072 /* Never */))
|
|
61004
61024
|
return false;
|
|
61005
61025
|
return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer);
|
|
61006
61026
|
}
|
|
@@ -61023,16 +61043,24 @@ ${lanes.join("\n")}
|
|
|
61023
61043
|
void 0
|
|
61024
61044
|
) !== 0 /* False */;
|
|
61025
61045
|
}
|
|
61026
|
-
function
|
|
61027
|
-
|
|
61046
|
+
function isTopSignature(s) {
|
|
61047
|
+
if (!s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 && signatureHasRestParameter(s)) {
|
|
61048
|
+
const paramType = getTypeOfParameter(s.parameters[0]);
|
|
61049
|
+
const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType;
|
|
61050
|
+
return !!(restType.flags & (1 /* Any */ | 131072 /* Never */) && getReturnTypeOfSignature(s).flags & 3 /* AnyOrUnknown */);
|
|
61051
|
+
}
|
|
61052
|
+
return false;
|
|
61028
61053
|
}
|
|
61029
61054
|
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) {
|
|
61030
61055
|
if (source === target) {
|
|
61031
61056
|
return -1 /* True */;
|
|
61032
61057
|
}
|
|
61033
|
-
if (
|
|
61058
|
+
if (!(checkMode & 16 /* StrictTopSignature */ && isTopSignature(source)) && isTopSignature(target)) {
|
|
61034
61059
|
return -1 /* True */;
|
|
61035
61060
|
}
|
|
61061
|
+
if (checkMode & 16 /* StrictTopSignature */ && isTopSignature(source) && !isTopSignature(target)) {
|
|
61062
|
+
return 0 /* False */;
|
|
61063
|
+
}
|
|
61036
61064
|
const targetCount = getParameterCount(target);
|
|
61037
61065
|
const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount);
|
|
61038
61066
|
if (sourceHasMoreParameters) {
|
|
@@ -61250,7 +61278,9 @@ ${lanes.join("\n")}
|
|
|
61250
61278
|
function isSimpleTypeRelatedTo(source, target, relation, errorReporter) {
|
|
61251
61279
|
const s = source.flags;
|
|
61252
61280
|
const t = target.flags;
|
|
61253
|
-
if (t &
|
|
61281
|
+
if (t & 1 /* Any */ || s & 131072 /* Never */ || source === wildcardType)
|
|
61282
|
+
return true;
|
|
61283
|
+
if (t & 2 /* Unknown */ && !(relation === strictSubtypeRelation && s & 1 /* Any */))
|
|
61254
61284
|
return true;
|
|
61255
61285
|
if (t & 131072 /* Never */)
|
|
61256
61286
|
return false;
|
|
@@ -61647,7 +61677,7 @@ ${lanes.join("\n")}
|
|
|
61647
61677
|
return isRelatedTo(source2, target2, 3 /* Both */, reportErrors2);
|
|
61648
61678
|
}
|
|
61649
61679
|
function isRelatedTo(originalSource, originalTarget, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2, intersectionState = 0 /* None */) {
|
|
61650
|
-
if (originalSource.flags & 524288 /* Object */ && originalTarget.flags &
|
|
61680
|
+
if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 134348796 /* Primitive */) {
|
|
61651
61681
|
if (relation === comparableRelation && !(originalTarget.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(originalTarget, originalSource, relation) || isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors2 ? reportError : void 0)) {
|
|
61652
61682
|
return -1 /* True */;
|
|
61653
61683
|
}
|
|
@@ -61711,7 +61741,7 @@ ${lanes.join("\n")}
|
|
|
61711
61741
|
return 0 /* False */;
|
|
61712
61742
|
}
|
|
61713
61743
|
}
|
|
61714
|
-
const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (
|
|
61744
|
+
const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (134348796 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures2(source2));
|
|
61715
61745
|
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */);
|
|
61716
61746
|
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) {
|
|
61717
61747
|
if (reportErrors2) {
|
|
@@ -61773,7 +61803,7 @@ ${lanes.join("\n")}
|
|
|
61773
61803
|
maybeSuppress = !!errorInfo;
|
|
61774
61804
|
}
|
|
61775
61805
|
}
|
|
61776
|
-
if (source2.flags & 524288 /* Object */ && target2.flags &
|
|
61806
|
+
if (source2.flags & 524288 /* Object */ && target2.flags & 134348796 /* Primitive */) {
|
|
61777
61807
|
tryElaborateErrorsForPrimitivesAndObjects(source2, target2);
|
|
61778
61808
|
} else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) {
|
|
61779
61809
|
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
@@ -61919,15 +61949,15 @@ ${lanes.join("\n")}
|
|
|
61919
61949
|
}
|
|
61920
61950
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
61921
61951
|
if (source2.flags & 1048576 /* Union */) {
|
|
61922
|
-
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags &
|
|
61952
|
+
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */), intersectionState);
|
|
61923
61953
|
}
|
|
61924
61954
|
if (target2.flags & 1048576 /* Union */) {
|
|
61925
|
-
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags &
|
|
61955
|
+
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 134348796 /* Primitive */) && !(target2.flags & 134348796 /* Primitive */));
|
|
61926
61956
|
}
|
|
61927
61957
|
if (target2.flags & 2097152 /* Intersection */) {
|
|
61928
61958
|
return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */);
|
|
61929
61959
|
}
|
|
61930
|
-
if (relation === comparableRelation && target2.flags &
|
|
61960
|
+
if (relation === comparableRelation && target2.flags & 134348796 /* Primitive */) {
|
|
61931
61961
|
const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t);
|
|
61932
61962
|
if (constraints !== source2.types) {
|
|
61933
61963
|
source2 = getIntersectionType(constraints);
|
|
@@ -62820,7 +62850,7 @@ ${lanes.join("\n")}
|
|
|
62820
62850
|
}
|
|
62821
62851
|
return 0 /* False */;
|
|
62822
62852
|
}
|
|
62823
|
-
const sourceIsPrimitive = !!(sourceFlags &
|
|
62853
|
+
const sourceIsPrimitive = !!(sourceFlags & 134348796 /* Primitive */);
|
|
62824
62854
|
if (relation !== identityRelation) {
|
|
62825
62855
|
source2 = getApparentType(source2);
|
|
62826
62856
|
sourceFlags = source2.flags;
|
|
@@ -63490,10 +63520,11 @@ ${lanes.join("\n")}
|
|
|
63490
63520
|
return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2));
|
|
63491
63521
|
}
|
|
63492
63522
|
function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) {
|
|
63523
|
+
const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */;
|
|
63493
63524
|
return compareSignaturesRelated(
|
|
63494
63525
|
erase ? getErasedSignature(source2) : source2,
|
|
63495
63526
|
erase ? getErasedSignature(target2) : target2,
|
|
63496
|
-
|
|
63527
|
+
checkMode,
|
|
63497
63528
|
reportErrors2,
|
|
63498
63529
|
reportError,
|
|
63499
63530
|
incompatibleReporter,
|
|
@@ -63618,7 +63649,7 @@ ${lanes.join("\n")}
|
|
|
63618
63649
|
if (sourceInfo) {
|
|
63619
63650
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
63620
63651
|
}
|
|
63621
|
-
if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source2)) {
|
|
63652
|
+
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 8192 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) {
|
|
63622
63653
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
63623
63654
|
}
|
|
63624
63655
|
if (reportErrors2) {
|
|
@@ -64163,10 +64194,10 @@ ${lanes.join("\n")}
|
|
|
64163
64194
|
return void 0;
|
|
64164
64195
|
}
|
|
64165
64196
|
function isNeitherUnitTypeNorNever(type) {
|
|
64166
|
-
return !(type.flags & (
|
|
64197
|
+
return !(type.flags & (109472 /* Unit */ | 131072 /* Never */));
|
|
64167
64198
|
}
|
|
64168
64199
|
function isUnitType(type) {
|
|
64169
|
-
return !!(type.flags &
|
|
64200
|
+
return !!(type.flags & 109472 /* Unit */);
|
|
64170
64201
|
}
|
|
64171
64202
|
function isUnitLikeType(type) {
|
|
64172
64203
|
const t = getBaseConstraintOrType(type);
|
|
@@ -64179,7 +64210,7 @@ ${lanes.join("\n")}
|
|
|
64179
64210
|
return type.flags & 16 /* Boolean */ ? true : type.flags & 1048576 /* Union */ ? type.flags & 1024 /* EnumLiteral */ ? true : every(type.types, isUnitType) : isUnitType(type);
|
|
64180
64211
|
}
|
|
64181
64212
|
function getBaseTypeOfLiteralType(type) {
|
|
64182
|
-
return type.flags &
|
|
64213
|
+
return type.flags & 1056 /* EnumLike */ ? getBaseTypeOfEnumLikeType(type) : type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? getBaseTypeOfLiteralTypeUnion(type) : type;
|
|
64183
64214
|
}
|
|
64184
64215
|
function getBaseTypeOfLiteralTypeUnion(type) {
|
|
64185
64216
|
var _a2;
|
|
@@ -64187,7 +64218,7 @@ ${lanes.join("\n")}
|
|
|
64187
64218
|
return (_a2 = getCachedType(key)) != null ? _a2 : setCachedType(key, mapType(type, getBaseTypeOfLiteralType));
|
|
64188
64219
|
}
|
|
64189
64220
|
function getWidenedLiteralType(type) {
|
|
64190
|
-
return type.flags &
|
|
64221
|
+
return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type;
|
|
64191
64222
|
}
|
|
64192
64223
|
function getWidenedUniqueESSymbolType(type) {
|
|
64193
64224
|
return type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedUniqueESSymbolType) : type;
|
|
@@ -64720,8 +64751,8 @@ ${lanes.join("\n")}
|
|
|
64720
64751
|
}
|
|
64721
64752
|
return false;
|
|
64722
64753
|
}
|
|
64723
|
-
function isTypeParameterAtTopLevel(type,
|
|
64724
|
-
return !!(type ===
|
|
64754
|
+
function isTypeParameterAtTopLevel(type, tp, depth = 0) {
|
|
64755
|
+
return !!(type === tp || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, tp, depth)) || depth < 3 && type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), tp, depth + 1) || isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), tp, depth + 1)));
|
|
64725
64756
|
}
|
|
64726
64757
|
function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) {
|
|
64727
64758
|
const typePredicate = getTypePredicateOfSignature(signature);
|
|
@@ -64815,7 +64846,7 @@ ${lanes.join("\n")}
|
|
|
64815
64846
|
yield targetProp;
|
|
64816
64847
|
} else if (matchDiscriminantProperties) {
|
|
64817
64848
|
const targetType = getTypeOfSymbol(targetProp);
|
|
64818
|
-
if (targetType.flags &
|
|
64849
|
+
if (targetType.flags & 109472 /* Unit */) {
|
|
64819
64850
|
const sourceType = getTypeOfSymbol(sourceProp);
|
|
64820
64851
|
if (!(sourceType.flags & 1 /* Any */ || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) {
|
|
64821
64852
|
yield targetProp;
|
|
@@ -64876,10 +64907,10 @@ ${lanes.join("\n")}
|
|
|
64876
64907
|
return getBigIntLiteralType(parseValidBigInt(text));
|
|
64877
64908
|
}
|
|
64878
64909
|
function isMemberOfStringMapping(source, target) {
|
|
64879
|
-
if (target.flags &
|
|
64910
|
+
if (target.flags & 1 /* Any */) {
|
|
64880
64911
|
return true;
|
|
64881
64912
|
}
|
|
64882
|
-
if (target.flags & 134217728 /* TemplateLiteral */) {
|
|
64913
|
+
if (target.flags & (4 /* String */ | 134217728 /* TemplateLiteral */)) {
|
|
64883
64914
|
return isTypeAssignableTo(source, target);
|
|
64884
64915
|
}
|
|
64885
64916
|
if (target.flags & 268435456 /* StringMapping */) {
|
|
@@ -65574,7 +65605,7 @@ ${lanes.join("\n")}
|
|
|
65574
65605
|
}
|
|
65575
65606
|
function hasPrimitiveConstraint(type) {
|
|
65576
65607
|
const constraint = getConstraintOfTypeParameter(type);
|
|
65577
|
-
return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint,
|
|
65608
|
+
return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
|
|
65578
65609
|
}
|
|
65579
65610
|
function isObjectLiteralType2(type) {
|
|
65580
65611
|
return !!(getObjectFlags(type) & 128 /* ObjectLiteral */);
|
|
@@ -66056,7 +66087,7 @@ ${lanes.join("\n")}
|
|
|
66056
66087
|
return 83886079 /* UnknownFacts */;
|
|
66057
66088
|
}
|
|
66058
66089
|
function getIntersectionTypeFacts(type) {
|
|
66059
|
-
const ignoreObjects = maybeTypeOfKind(type,
|
|
66090
|
+
const ignoreObjects = maybeTypeOfKind(type, 134348796 /* Primitive */);
|
|
66060
66091
|
let oredFacts = 0 /* None */;
|
|
66061
66092
|
let andedFacts = 134217727 /* All */;
|
|
66062
66093
|
for (const t of type.types) {
|
|
@@ -66255,7 +66286,7 @@ ${lanes.join("\n")}
|
|
|
66255
66286
|
}
|
|
66256
66287
|
return true;
|
|
66257
66288
|
}
|
|
66258
|
-
if (source.flags &
|
|
66289
|
+
if (source.flags & 1056 /* EnumLike */ && getBaseTypeOfEnumLikeType(source) === target) {
|
|
66259
66290
|
return true;
|
|
66260
66291
|
}
|
|
66261
66292
|
return containsType(target.types, source);
|
|
@@ -67319,7 +67350,7 @@ ${lanes.join("\n")}
|
|
|
67319
67350
|
}
|
|
67320
67351
|
if (assumeTrue) {
|
|
67321
67352
|
if (!doubleEquals && (type.flags & 2 /* Unknown */ || someType(type, isEmptyAnonymousObjectType))) {
|
|
67322
|
-
if (valueType.flags & (
|
|
67353
|
+
if (valueType.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */) || isEmptyAnonymousObjectType(valueType)) {
|
|
67323
67354
|
return valueType;
|
|
67324
67355
|
}
|
|
67325
67356
|
if (valueType.flags & 524288 /* Object */) {
|
|
@@ -67369,7 +67400,7 @@ ${lanes.join("\n")}
|
|
|
67369
67400
|
let groundClauseTypes;
|
|
67370
67401
|
for (let i = 0; i < clauseTypes.length; i += 1) {
|
|
67371
67402
|
const t = clauseTypes[i];
|
|
67372
|
-
if (t.flags & (
|
|
67403
|
+
if (t.flags & (134348796 /* Primitive */ | 67108864 /* NonPrimitive */)) {
|
|
67373
67404
|
if (groundClauseTypes !== void 0) {
|
|
67374
67405
|
groundClauseTypes.push(t);
|
|
67375
67406
|
}
|
|
@@ -67517,18 +67548,29 @@ ${lanes.join("\n")}
|
|
|
67517
67548
|
return (_a3 = getCachedType(key2)) != null ? _a3 : setCachedType(key2, getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived));
|
|
67518
67549
|
}
|
|
67519
67550
|
function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) {
|
|
67520
|
-
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
67521
67551
|
if (!assumeTrue) {
|
|
67522
|
-
|
|
67552
|
+
if (checkDerived) {
|
|
67553
|
+
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
|
|
67554
|
+
}
|
|
67555
|
+
const trueType2 = getNarrowedType(
|
|
67556
|
+
type,
|
|
67557
|
+
candidate,
|
|
67558
|
+
/*assumeTrue*/
|
|
67559
|
+
true,
|
|
67560
|
+
/*checkDerived*/
|
|
67561
|
+
false
|
|
67562
|
+
);
|
|
67563
|
+
return filterType(type, (t) => !isTypeSubsetOf(t, trueType2));
|
|
67523
67564
|
}
|
|
67524
67565
|
if (type.flags & 3 /* AnyOrUnknown */) {
|
|
67525
67566
|
return candidate;
|
|
67526
67567
|
}
|
|
67568
|
+
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
67527
67569
|
const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0;
|
|
67528
67570
|
const narrowedType = mapType(candidate, (c) => {
|
|
67529
67571
|
const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName);
|
|
67530
67572
|
const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
|
|
67531
|
-
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType);
|
|
67573
|
+
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType);
|
|
67532
67574
|
return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
|
|
67533
67575
|
});
|
|
67534
67576
|
return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]);
|
|
@@ -67684,15 +67726,25 @@ ${lanes.join("\n")}
|
|
|
67684
67726
|
function isConstVariable(symbol) {
|
|
67685
67727
|
return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0;
|
|
67686
67728
|
}
|
|
67687
|
-
function
|
|
67688
|
-
|
|
67689
|
-
|
|
67690
|
-
|
|
67691
|
-
|
|
67692
|
-
|
|
67693
|
-
|
|
67694
|
-
|
|
67729
|
+
function parameterInitializerContainsUndefined(declaration) {
|
|
67730
|
+
const links = getNodeLinks(declaration);
|
|
67731
|
+
if (links.parameterInitializerContainsUndefined === void 0) {
|
|
67732
|
+
if (!pushTypeResolution(declaration, 9 /* ParameterInitializerContainsUndefined */)) {
|
|
67733
|
+
reportCircularityError(declaration.symbol);
|
|
67734
|
+
return true;
|
|
67735
|
+
}
|
|
67736
|
+
const containsUndefined = !!(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */);
|
|
67737
|
+
if (!popTypeResolution()) {
|
|
67738
|
+
reportCircularityError(declaration.symbol);
|
|
67739
|
+
return true;
|
|
67740
|
+
}
|
|
67741
|
+
links.parameterInitializerContainsUndefined = containsUndefined;
|
|
67695
67742
|
}
|
|
67743
|
+
return links.parameterInitializerContainsUndefined;
|
|
67744
|
+
}
|
|
67745
|
+
function removeOptionalityFromDeclaredType(declaredType, declaration) {
|
|
67746
|
+
const removeUndefined = strictNullChecks && declaration.kind === 166 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !parameterInitializerContainsUndefined(declaration);
|
|
67747
|
+
return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
|
|
67696
67748
|
}
|
|
67697
67749
|
function isConstraintPosition(type, node) {
|
|
67698
67750
|
const parent2 = node.parent;
|
|
@@ -70858,7 +70910,7 @@ ${lanes.join("\n")}
|
|
|
70858
70910
|
function reportNonexistentProperty(propNode, containingType, isUncheckedJS) {
|
|
70859
70911
|
let errorInfo;
|
|
70860
70912
|
let relatedInfo;
|
|
70861
|
-
if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags &
|
|
70913
|
+
if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 134348796 /* Primitive */)) {
|
|
70862
70914
|
for (const subtype of containingType.types) {
|
|
70863
70915
|
if (!getPropertyOfType(subtype, propNode.escapedText) && !getApplicableIndexInfoForName(subtype, propNode.escapedText)) {
|
|
70864
70916
|
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(subtype));
|
|
@@ -71455,7 +71507,7 @@ ${lanes.join("\n")}
|
|
|
71455
71507
|
} else {
|
|
71456
71508
|
const contextualType = getIndexedAccessType(restType, getNumberLiteralType(i - index), 256 /* Contextual */);
|
|
71457
71509
|
const argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode);
|
|
71458
|
-
const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType,
|
|
71510
|
+
const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind(contextualType, 134348796 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
|
|
71459
71511
|
types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType));
|
|
71460
71512
|
flags.push(1 /* Required */);
|
|
71461
71513
|
}
|
|
@@ -74705,7 +74757,7 @@ ${lanes.join("\n")}
|
|
|
74705
74757
|
if (leftType === silentNeverType || rightType === silentNeverType) {
|
|
74706
74758
|
return silentNeverType;
|
|
74707
74759
|
}
|
|
74708
|
-
if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType,
|
|
74760
|
+
if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 134348796 /* Primitive */)) {
|
|
74709
74761
|
error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
|
|
74710
74762
|
}
|
|
74711
74763
|
if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures2(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {
|
|
@@ -75291,7 +75343,7 @@ ${lanes.join("\n")}
|
|
|
75291
75343
|
return leftType;
|
|
75292
75344
|
} else {
|
|
75293
75345
|
checkAssignmentOperator(rightType);
|
|
75294
|
-
return
|
|
75346
|
+
return rightType;
|
|
75295
75347
|
}
|
|
75296
75348
|
case 27 /* CommaToken */:
|
|
75297
75349
|
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) {
|
|
@@ -77198,6 +77250,9 @@ ${lanes.join("\n")}
|
|
|
77198
77250
|
case 273 /* ImportSpecifier */:
|
|
77199
77251
|
case 79 /* Identifier */:
|
|
77200
77252
|
return 1 /* ExportValue */;
|
|
77253
|
+
case 170 /* MethodSignature */:
|
|
77254
|
+
case 168 /* PropertySignature */:
|
|
77255
|
+
return 2 /* ExportType */;
|
|
77201
77256
|
default:
|
|
77202
77257
|
return Debug.failBadSyntaxKind(d);
|
|
77203
77258
|
}
|
|
@@ -77221,7 +77276,7 @@ ${lanes.join("\n")}
|
|
|
77221
77276
|
))) {
|
|
77222
77277
|
return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0];
|
|
77223
77278
|
}
|
|
77224
|
-
if (allTypesAssignableToKind(getBaseConstraintOrType(type),
|
|
77279
|
+
if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) {
|
|
77225
77280
|
return void 0;
|
|
77226
77281
|
}
|
|
77227
77282
|
const thenFunction = getTypeOfPropertyOfType(type, "then");
|
|
@@ -77273,7 +77328,7 @@ ${lanes.join("\n")}
|
|
|
77273
77328
|
return awaitedType || errorType;
|
|
77274
77329
|
}
|
|
77275
77330
|
function isThenableType(type) {
|
|
77276
|
-
if (allTypesAssignableToKind(getBaseConstraintOrType(type),
|
|
77331
|
+
if (allTypesAssignableToKind(getBaseConstraintOrType(type), 134348796 /* Primitive */ | 131072 /* Never */)) {
|
|
77277
77332
|
return false;
|
|
77278
77333
|
}
|
|
77279
77334
|
const thenFunction = getTypeOfPropertyOfType(type, "then");
|
|
@@ -77322,7 +77377,7 @@ ${lanes.join("\n")}
|
|
|
77322
77377
|
return awaitedType;
|
|
77323
77378
|
}
|
|
77324
77379
|
}
|
|
77325
|
-
Debug.assert(getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like.");
|
|
77380
|
+
Debug.assert(isAwaitedTypeInstantiation(type) || getPromisedTypeOfPromise(type) === void 0, "type provided should not be a non-generic 'promise'-like.");
|
|
77326
77381
|
return type;
|
|
77327
77382
|
}
|
|
77328
77383
|
function getAwaitedType(type, errorNode, diagnosticMessage, arg0) {
|
|
@@ -81581,6 +81636,8 @@ ${lanes.join("\n")}
|
|
|
81581
81636
|
if (!(links.flags & 1 /* TypeChecked */)) {
|
|
81582
81637
|
links.deferredNodes || (links.deferredNodes = /* @__PURE__ */ new Set());
|
|
81583
81638
|
links.deferredNodes.add(node);
|
|
81639
|
+
} else {
|
|
81640
|
+
Debug.assert(!links.deferredNodes, "A type-checked file should have no deferred nodes.");
|
|
81584
81641
|
}
|
|
81585
81642
|
}
|
|
81586
81643
|
function checkDeferredNodes(context) {
|
|
@@ -81588,6 +81645,7 @@ ${lanes.join("\n")}
|
|
|
81588
81645
|
if (links.deferredNodes) {
|
|
81589
81646
|
links.deferredNodes.forEach(checkDeferredNode);
|
|
81590
81647
|
}
|
|
81648
|
+
links.deferredNodes = void 0;
|
|
81591
81649
|
}
|
|
81592
81650
|
function checkDeferredNode(node) {
|
|
81593
81651
|
var _a2, _b;
|
|
@@ -82668,7 +82726,7 @@ ${lanes.join("\n")}
|
|
|
82668
82726
|
return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0;
|
|
82669
82727
|
}
|
|
82670
82728
|
function getTypeReferenceSerializationKind(typeNameIn, location) {
|
|
82671
|
-
var _a2
|
|
82729
|
+
var _a2;
|
|
82672
82730
|
const typeName = getParseTreeNode(typeNameIn, isEntityName);
|
|
82673
82731
|
if (!typeName)
|
|
82674
82732
|
return 0 /* Unknown */;
|
|
@@ -82700,7 +82758,7 @@ ${lanes.join("\n")}
|
|
|
82700
82758
|
location
|
|
82701
82759
|
);
|
|
82702
82760
|
const resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol;
|
|
82703
|
-
isTypeOnly || (isTypeOnly = !!(
|
|
82761
|
+
isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */)));
|
|
82704
82762
|
const typeSymbol = resolveEntityName(
|
|
82705
82763
|
typeName,
|
|
82706
82764
|
788968 /* Type */,
|
|
@@ -82851,7 +82909,7 @@ ${lanes.join("\n")}
|
|
|
82851
82909
|
return false;
|
|
82852
82910
|
}
|
|
82853
82911
|
function literalTypeToNode(type, enclosing, tracker) {
|
|
82854
|
-
const enumResult = type.flags &
|
|
82912
|
+
const enumResult = type.flags & 1056 /* EnumLike */ ? nodeBuilder.symbolToExpression(
|
|
82855
82913
|
type.symbol,
|
|
82856
82914
|
111551 /* Value */,
|
|
82857
82915
|
enclosing,
|
|
@@ -84412,7 +84470,7 @@ ${lanes.join("\n")}
|
|
|
84412
84470
|
}
|
|
84413
84471
|
function isSimpleLiteralEnumReference(expr) {
|
|
84414
84472
|
if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) {
|
|
84415
|
-
return !!(checkExpressionCached(expr).flags &
|
|
84473
|
+
return !!(checkExpressionCached(expr).flags & 1056 /* EnumLike */);
|
|
84416
84474
|
}
|
|
84417
84475
|
}
|
|
84418
84476
|
function checkAmbientInitializer(node) {
|
|
@@ -84814,10 +84872,10 @@ ${lanes.join("\n")}
|
|
|
84814
84872
|
}
|
|
84815
84873
|
function findMostOverlappyType(source, unionTarget) {
|
|
84816
84874
|
let bestMatch;
|
|
84817
|
-
if (!(source.flags & (
|
|
84875
|
+
if (!(source.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
|
|
84818
84876
|
let matchingCount = 0;
|
|
84819
84877
|
for (const target of unionTarget.types) {
|
|
84820
|
-
if (!(target.flags & (
|
|
84878
|
+
if (!(target.flags & (134348796 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
|
|
84821
84879
|
const overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
|
|
84822
84880
|
if (overlap.flags & 4194304 /* Index */) {
|
|
84823
84881
|
return target;
|
|
@@ -84835,7 +84893,7 @@ ${lanes.join("\n")}
|
|
|
84835
84893
|
}
|
|
84836
84894
|
function filterPrimitivesIfContainsNonPrimitive(type) {
|
|
84837
84895
|
if (maybeTypeOfKind(type, 67108864 /* NonPrimitive */)) {
|
|
84838
|
-
const result = filterType(type, (t) => !(t.flags &
|
|
84896
|
+
const result = filterType(type, (t) => !(t.flags & 134348796 /* Primitive */));
|
|
84839
84897
|
if (!(result.flags & 131072 /* Never */)) {
|
|
84840
84898
|
return result;
|
|
84841
84899
|
}
|
|
@@ -85035,6 +85093,7 @@ ${lanes.join("\n")}
|
|
|
85035
85093
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
85036
85094
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
85037
85095
|
SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity";
|
|
85096
|
+
SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature";
|
|
85038
85097
|
SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback";
|
|
85039
85098
|
return SignatureCheckMode3;
|
|
85040
85099
|
})(SignatureCheckMode || {});
|
|
@@ -89751,7 +89810,7 @@ ${lanes.join("\n")}
|
|
|
89751
89810
|
return node;
|
|
89752
89811
|
}
|
|
89753
89812
|
function tryGetConstEnumValue(node) {
|
|
89754
|
-
if (compilerOptions
|
|
89813
|
+
if (getIsolatedModules(compilerOptions)) {
|
|
89755
89814
|
return void 0;
|
|
89756
89815
|
}
|
|
89757
89816
|
return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0;
|
|
@@ -106193,7 +106252,7 @@ ${lanes.join("\n")}
|
|
|
106193
106252
|
if (node.isDeclarationFile) {
|
|
106194
106253
|
return node;
|
|
106195
106254
|
}
|
|
106196
|
-
if (isExternalModule(node) || compilerOptions
|
|
106255
|
+
if (isExternalModule(node) || getIsolatedModules(compilerOptions)) {
|
|
106197
106256
|
currentSourceFile = node;
|
|
106198
106257
|
importRequireStatements = void 0;
|
|
106199
106258
|
let result = updateExternalModule(node);
|
|
@@ -106400,7 +106459,7 @@ ${lanes.join("\n")}
|
|
|
106400
106459
|
}
|
|
106401
106460
|
function onEmitNode(hint, node, emitCallback) {
|
|
106402
106461
|
if (isSourceFile(node)) {
|
|
106403
|
-
if ((isExternalModule(node) || compilerOptions
|
|
106462
|
+
if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) {
|
|
106404
106463
|
helperNameSubstitutions = /* @__PURE__ */ new Map();
|
|
106405
106464
|
}
|
|
106406
106465
|
previousOnEmitNode(hint, node, emitCallback);
|
|
@@ -116988,7 +117047,7 @@ ${lanes.join("\n")}
|
|
|
116988
117047
|
let imports;
|
|
116989
117048
|
let moduleAugmentations;
|
|
116990
117049
|
let ambientModules;
|
|
116991
|
-
if ((options
|
|
117050
|
+
if ((getIsolatedModules(options) || isExternalModuleFile) && !file.isDeclarationFile) {
|
|
116992
117051
|
if (options.importHelpers) {
|
|
116993
117052
|
imports = [createSyntheticImport(externalHelpersModuleNameText, file)];
|
|
116994
117053
|
}
|
|
@@ -117709,12 +117768,12 @@ ${lanes.join("\n")}
|
|
|
117709
117768
|
if (options.exactOptionalPropertyTypes && !getStrictOptionValue(options, "strictNullChecks")) {
|
|
117710
117769
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks");
|
|
117711
117770
|
}
|
|
117712
|
-
if (options.isolatedModules) {
|
|
117771
|
+
if (options.isolatedModules || options.verbatimModuleSyntax) {
|
|
117713
117772
|
if (options.out) {
|
|
117714
|
-
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules");
|
|
117773
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules");
|
|
117715
117774
|
}
|
|
117716
117775
|
if (options.outFile) {
|
|
117717
|
-
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", "isolatedModules");
|
|
117776
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules");
|
|
117718
117777
|
}
|
|
117719
117778
|
}
|
|
117720
117779
|
if (options.inlineSourceMap) {
|
|
@@ -119271,7 +119330,7 @@ ${lanes.join("\n")}
|
|
|
119271
119330
|
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
|
|
119272
119331
|
}
|
|
119273
119332
|
const compilerOptions = programOfThisState.getCompilerOptions();
|
|
119274
|
-
if (compilerOptions && (compilerOptions
|
|
119333
|
+
if (compilerOptions && (getIsolatedModules(compilerOptions) || outFile(compilerOptions))) {
|
|
119275
119334
|
return [sourceFileWithUpdatedShape];
|
|
119276
119335
|
}
|
|
119277
119336
|
const seenFileNamesMap = /* @__PURE__ */ new Map();
|
|
@@ -119686,7 +119745,7 @@ ${lanes.join("\n")}
|
|
|
119686
119745
|
return;
|
|
119687
119746
|
if (!isChangedSignature(state, affectedFile.resolvedPath))
|
|
119688
119747
|
return;
|
|
119689
|
-
if (state.compilerOptions
|
|
119748
|
+
if (getIsolatedModules(state.compilerOptions)) {
|
|
119690
119749
|
const seenFileNamesMap = /* @__PURE__ */ new Map();
|
|
119691
119750
|
seenFileNamesMap.set(affectedFile.resolvedPath, true);
|
|
119692
119751
|
const queue = BuilderState.getReferencedByPaths(state, affectedFile.resolvedPath);
|
|
@@ -139964,7 +140023,8 @@ ${lanes.join("\n")}
|
|
|
139964
140023
|
quotePreference,
|
|
139965
140024
|
defaultImport,
|
|
139966
140025
|
namedImports && arrayFrom(namedImports.entries(), ([name, addAsTypeOnly]) => ({ addAsTypeOnly, name })),
|
|
139967
|
-
namespaceLikeImport
|
|
140026
|
+
namespaceLikeImport,
|
|
140027
|
+
compilerOptions
|
|
139968
140028
|
);
|
|
139969
140029
|
newDeclarations = combine(newDeclarations, declarations);
|
|
139970
140030
|
});
|
|
@@ -140142,7 +140202,7 @@ ${lanes.join("\n")}
|
|
|
140142
140202
|
if (isForNewImportDeclaration && compilerOptions.importsNotUsedAsValues === 2 /* Error */) {
|
|
140143
140203
|
return 2 /* Required */;
|
|
140144
140204
|
}
|
|
140145
|
-
if ((compilerOptions
|
|
140205
|
+
if (importNameElisionDisabled(compilerOptions) && (!(targetFlags & 111551 /* Value */) || !!checker.getTypeOnlyAliasDeclaration(symbol))) {
|
|
140146
140206
|
return 2 /* Required */;
|
|
140147
140207
|
}
|
|
140148
140208
|
return 1 /* Allowed */;
|
|
@@ -140626,7 +140686,14 @@ ${lanes.join("\n")}
|
|
|
140626
140686
|
insertImports(
|
|
140627
140687
|
changes,
|
|
140628
140688
|
sourceFile,
|
|
140629
|
-
getDeclarations(
|
|
140689
|
+
getDeclarations(
|
|
140690
|
+
moduleSpecifier,
|
|
140691
|
+
quotePreference,
|
|
140692
|
+
defaultImport,
|
|
140693
|
+
namedImports,
|
|
140694
|
+
namespaceLikeImport,
|
|
140695
|
+
compilerOptions
|
|
140696
|
+
),
|
|
140630
140697
|
/*blankLineBetween*/
|
|
140631
140698
|
true,
|
|
140632
140699
|
preferences
|
|
@@ -140650,7 +140717,7 @@ ${lanes.join("\n")}
|
|
|
140650
140717
|
return promotedDeclaration.kind === 268 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text;
|
|
140651
140718
|
}
|
|
140652
140719
|
function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile, preferences) {
|
|
140653
|
-
const convertExistingToTypeOnly = compilerOptions
|
|
140720
|
+
const convertExistingToTypeOnly = importNameElisionDisabled(compilerOptions);
|
|
140654
140721
|
switch (aliasDeclaration.kind) {
|
|
140655
140722
|
case 273 /* ImportSpecifier */:
|
|
140656
140723
|
if (aliasDeclaration.isTypeOnly) {
|
|
@@ -140724,7 +140791,7 @@ ${lanes.join("\n")}
|
|
|
140724
140791
|
}
|
|
140725
140792
|
const promoteFromTypeOnly2 = clause.isTypeOnly && some([defaultImport, ...namedImports], (i) => (i == null ? void 0 : i.addAsTypeOnly) === 4 /* NotAllowed */);
|
|
140726
140793
|
const existingSpecifiers = clause.namedBindings && ((_a2 = tryCast(clause.namedBindings, isNamedImports)) == null ? void 0 : _a2.elements);
|
|
140727
|
-
const convertExistingToTypeOnly = promoteFromTypeOnly2 && (compilerOptions
|
|
140794
|
+
const convertExistingToTypeOnly = promoteFromTypeOnly2 && importNameElisionDisabled(compilerOptions);
|
|
140728
140795
|
if (defaultImport) {
|
|
140729
140796
|
Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one");
|
|
140730
140797
|
changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), factory.createIdentifier(defaultImport.name), { suffix: ", " });
|
|
@@ -140808,11 +140875,11 @@ ${lanes.join("\n")}
|
|
|
140808
140875
|
function needsTypeOnly({ addAsTypeOnly }) {
|
|
140809
140876
|
return addAsTypeOnly === 2 /* Required */;
|
|
140810
140877
|
}
|
|
140811
|
-
function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport) {
|
|
140878
|
+
function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, compilerOptions) {
|
|
140812
140879
|
const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference);
|
|
140813
140880
|
let statements;
|
|
140814
140881
|
if (defaultImport !== void 0 || (namedImports == null ? void 0 : namedImports.length)) {
|
|
140815
|
-
const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly);
|
|
140882
|
+
const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || compilerOptions.verbatimModuleSyntax && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */);
|
|
140816
140883
|
statements = combine(statements, makeImport(
|
|
140817
140884
|
defaultImport && factory.createIdentifier(defaultImport.name),
|
|
140818
140885
|
namedImports == null ? void 0 : namedImports.map(({ addAsTypeOnly, name }) => factory.createImportSpecifier(
|
|
@@ -141446,7 +141513,7 @@ ${lanes.join("\n")}
|
|
|
141446
141513
|
}
|
|
141447
141514
|
function updateExport(changes, program, sourceFile, node, names) {
|
|
141448
141515
|
const namedExports = node.exportClause && isNamedExports(node.exportClause) ? node.exportClause.elements : factory.createNodeArray([]);
|
|
141449
|
-
const allowTypeModifier = !node.isTypeOnly && !!(program.getCompilerOptions()
|
|
141516
|
+
const allowTypeModifier = !node.isTypeOnly && !!(getIsolatedModules(program.getCompilerOptions()) || find(namedExports, (e) => e.isTypeOnly));
|
|
141450
141517
|
changes.replaceNode(
|
|
141451
141518
|
sourceFile,
|
|
141452
141519
|
node,
|
|
@@ -141478,7 +141545,7 @@ ${lanes.join("\n")}
|
|
|
141478
141545
|
factory.createNamedExports(createExportSpecifiers(
|
|
141479
141546
|
names,
|
|
141480
141547
|
/*allowTypeModifier*/
|
|
141481
|
-
|
|
141548
|
+
getIsolatedModules(program.getCompilerOptions())
|
|
141482
141549
|
)),
|
|
141483
141550
|
/*moduleSpecifier*/
|
|
141484
141551
|
void 0,
|
|
@@ -150202,7 +150269,7 @@ ${lanes.join("\n")}
|
|
|
150202
150269
|
function getApparentProperties(type, node, checker) {
|
|
150203
150270
|
if (!type.isUnion())
|
|
150204
150271
|
return type.getApparentProperties();
|
|
150205
|
-
return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags &
|
|
150272
|
+
return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 134348796 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || typeHasCallOrConstructSignatures(memberType, checker) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties()))));
|
|
150206
150273
|
}
|
|
150207
150274
|
function containsNonPublicProperties(props) {
|
|
150208
150275
|
return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 24 /* NonPublicAccessibilityModifier */));
|
|
@@ -155090,6 +155157,7 @@ ${lanes.join("\n")}
|
|
|
155090
155157
|
"module",
|
|
155091
155158
|
"name",
|
|
155092
155159
|
"namespace",
|
|
155160
|
+
"overload",
|
|
155093
155161
|
"override",
|
|
155094
155162
|
"package",
|
|
155095
155163
|
"param",
|