@typescript-deploys/pr-build 5.5.0-pr-58396-2 → 5.5.0-pr-58404-2
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 +316 -362
- package/lib/typescript.js +330 -379
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240503`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -17036,7 +17036,7 @@ function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
|
17036
17036
|
const flags = getCombinedModifierFlags(declaration);
|
|
17037
17037
|
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~7 /* AccessibilityModifier */;
|
|
17038
17038
|
}
|
|
17039
|
-
if (getCheckFlags(s) & 6 /*
|
|
17039
|
+
if (getCheckFlags(s) & 6 /* Synthetic */) {
|
|
17040
17040
|
const checkFlags = s.links.checkFlags;
|
|
17041
17041
|
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 2 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 1 /* Public */ : 4 /* Protected */;
|
|
17042
17042
|
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 256 /* Static */ : 0;
|
|
@@ -17832,19 +17832,7 @@ function getStrictOptionValue(compilerOptions, flag) {
|
|
|
17832
17832
|
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
17833
17833
|
}
|
|
17834
17834
|
function getNameOfScriptTarget(scriptTarget) {
|
|
17835
|
-
|
|
17836
|
-
return forEach(entries, ([key, value]) => value === scriptTarget ? key : void 0);
|
|
17837
|
-
}
|
|
17838
|
-
function getNameOfModuleKind(moduleKind) {
|
|
17839
|
-
const entries = [...moduleOptionDeclaration.type].reverse();
|
|
17840
|
-
return forEach(entries, ([key, value]) => value === moduleKind ? key : void 0);
|
|
17841
|
-
}
|
|
17842
|
-
function getNameOfModuleResolutionKind(moduleResolution) {
|
|
17843
|
-
if (moduleResolution === 2 /* Node10 */) {
|
|
17844
|
-
return "node10";
|
|
17845
|
-
}
|
|
17846
|
-
const entries = [...moduleResolutionOptionDeclaration.type].reverse();
|
|
17847
|
-
return forEach(entries, ([key, value]) => value === moduleResolution ? key : void 0);
|
|
17835
|
+
return forEachEntry(targetOptionDeclaration.type, (value, key) => value === scriptTarget ? key : void 0);
|
|
17848
17836
|
}
|
|
17849
17837
|
function getEmitStandardClassFields(compilerOptions) {
|
|
17850
17838
|
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
@@ -35952,25 +35940,6 @@ var moduleOptionDeclaration = {
|
|
|
35952
35940
|
description: Diagnostics.Specify_what_module_code_is_generated,
|
|
35953
35941
|
defaultValueDescription: void 0
|
|
35954
35942
|
};
|
|
35955
|
-
var moduleResolutionOptionDeclaration = {
|
|
35956
|
-
name: "moduleResolution",
|
|
35957
|
-
type: new Map(Object.entries({
|
|
35958
|
-
// N.B. The first entry specifies the value shown in `tsc --init`
|
|
35959
|
-
node10: 2 /* Node10 */,
|
|
35960
|
-
node: 2 /* Node10 */,
|
|
35961
|
-
classic: 1 /* Classic */,
|
|
35962
|
-
node16: 3 /* Node16 */,
|
|
35963
|
-
nodenext: 99 /* NodeNext */,
|
|
35964
|
-
bundler: 100 /* Bundler */
|
|
35965
|
-
})),
|
|
35966
|
-
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
35967
|
-
affectsSourceFile: true,
|
|
35968
|
-
affectsModuleResolution: true,
|
|
35969
|
-
paramType: Diagnostics.STRATEGY,
|
|
35970
|
-
category: Diagnostics.Modules,
|
|
35971
|
-
description: Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,
|
|
35972
|
-
defaultValueDescription: Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node
|
|
35973
|
-
};
|
|
35974
35943
|
var commandOptionsWithoutBuild = [
|
|
35975
35944
|
// CommandLine only options
|
|
35976
35945
|
{
|
|
@@ -36412,7 +36381,25 @@ var commandOptionsWithoutBuild = [
|
|
|
36412
36381
|
defaultValueDescription: false
|
|
36413
36382
|
},
|
|
36414
36383
|
// Module Resolution
|
|
36415
|
-
|
|
36384
|
+
{
|
|
36385
|
+
name: "moduleResolution",
|
|
36386
|
+
type: new Map(Object.entries({
|
|
36387
|
+
// N.B. The first entry specifies the value shown in `tsc --init`
|
|
36388
|
+
node10: 2 /* Node10 */,
|
|
36389
|
+
node: 2 /* Node10 */,
|
|
36390
|
+
classic: 1 /* Classic */,
|
|
36391
|
+
node16: 3 /* Node16 */,
|
|
36392
|
+
nodenext: 99 /* NodeNext */,
|
|
36393
|
+
bundler: 100 /* Bundler */
|
|
36394
|
+
})),
|
|
36395
|
+
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
36396
|
+
affectsSourceFile: true,
|
|
36397
|
+
affectsModuleResolution: true,
|
|
36398
|
+
paramType: Diagnostics.STRATEGY,
|
|
36399
|
+
category: Diagnostics.Modules,
|
|
36400
|
+
description: Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,
|
|
36401
|
+
defaultValueDescription: Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node
|
|
36402
|
+
},
|
|
36416
36403
|
{
|
|
36417
36404
|
name: "baseUrl",
|
|
36418
36405
|
type: "string",
|
|
@@ -45428,7 +45415,6 @@ function isInstantiatedModule(node, preserveConstEnums) {
|
|
|
45428
45415
|
return moduleState === 1 /* Instantiated */ || preserveConstEnums && moduleState === 2 /* ConstEnumOnly */;
|
|
45429
45416
|
}
|
|
45430
45417
|
function createTypeChecker(host) {
|
|
45431
|
-
var _a;
|
|
45432
45418
|
var deferredDiagnosticsCallbacks = [];
|
|
45433
45419
|
var addLazyDiagnostic = (arg) => {
|
|
45434
45420
|
deferredDiagnosticsCallbacks.push(arg);
|
|
@@ -45455,7 +45441,6 @@ function createTypeChecker(host) {
|
|
|
45455
45441
|
var compilerOptions = host.getCompilerOptions();
|
|
45456
45442
|
var languageVersion = getEmitScriptTarget(compilerOptions);
|
|
45457
45443
|
var moduleKind = getEmitModuleKind(compilerOptions);
|
|
45458
|
-
var moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
45459
45444
|
var legacyDecorators = !!compilerOptions.experimentalDecorators;
|
|
45460
45445
|
var useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
|
|
45461
45446
|
var emitStandardClassFields = getEmitStandardClassFields(compilerOptions);
|
|
@@ -45468,7 +45453,6 @@ function createTypeChecker(host) {
|
|
|
45468
45453
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
45469
45454
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
45470
45455
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
45471
|
-
var noUncheckedIndexedAccess = compilerOptions.noUncheckedIndexedAccess;
|
|
45472
45456
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
45473
45457
|
var emitResolver = createResolver();
|
|
45474
45458
|
var nodeBuilder = createNodeBuilder();
|
|
@@ -46436,32 +46420,6 @@ function createTypeChecker(host) {
|
|
|
46436
46420
|
[".jsx", ".jsx"],
|
|
46437
46421
|
[".json", ".json"]
|
|
46438
46422
|
];
|
|
46439
|
-
var typeScriptSettingsSymbol = createSymbol(64 /* Interface */, "TypeScriptSettings", 2097152 /* SyntheticInterface */);
|
|
46440
|
-
typeScriptSettingsSymbol.declarations = [];
|
|
46441
|
-
typeScriptSettingsSymbol.members = createSymbolTable([
|
|
46442
|
-
createProperty("version", getStringLiteralType(version), 8 /* Readonly */),
|
|
46443
|
-
createProperty("versionMajorMinor", getStringLiteralType(versionMajorMinor), 8 /* Readonly */),
|
|
46444
|
-
createProperty("locale", compilerOptions.locale ? getStringLiteralType(compilerOptions.locale) : undefinedType, 8 /* Readonly */),
|
|
46445
|
-
createProperty("target", getStringLiteralType(getNameOfScriptTarget(languageVersion) ?? ""), 8 /* Readonly */),
|
|
46446
|
-
createProperty("module", getStringLiteralType(getNameOfModuleKind(moduleKind) ?? ""), 8 /* Readonly */),
|
|
46447
|
-
createProperty("moduleResolution", getStringLiteralType(getNameOfModuleResolutionKind(moduleResolutionKind) ?? ""), 8 /* Readonly */),
|
|
46448
|
-
createProperty("customConditions", createTupleType(
|
|
46449
|
-
((_a = compilerOptions.customConditions) == null ? void 0 : _a.map((cond) => getStringLiteralType(cond))) ?? emptyArray,
|
|
46450
|
-
/*elementFlags*/
|
|
46451
|
-
void 0,
|
|
46452
|
-
/*readonly*/
|
|
46453
|
-
true
|
|
46454
|
-
), 8 /* Readonly */),
|
|
46455
|
-
createProperty("esModuleInterop", getESModuleInterop(compilerOptions) ? trueType : falseType, 8 /* Readonly */),
|
|
46456
|
-
createProperty("exactOptionalPropertyTypes", exactOptionalPropertyTypes ? trueType : falseType, 8 /* Readonly */),
|
|
46457
|
-
createProperty("noImplicitAny", noImplicitAny ? trueType : falseType, 8 /* Readonly */),
|
|
46458
|
-
createProperty("noUncheckedIndexedAccess", noUncheckedIndexedAccess ? trueType : falseType, 8 /* Readonly */),
|
|
46459
|
-
createProperty("strictBindCallApply", strictBindCallApply ? trueType : falseType, 8 /* Readonly */),
|
|
46460
|
-
createProperty("strictFunctionTypes", strictFunctionTypes ? trueType : falseType, 8 /* Readonly */),
|
|
46461
|
-
createProperty("strictNullChecks", strictNullChecks ? trueType : falseType, 8 /* Readonly */),
|
|
46462
|
-
createProperty("useDefineForClassFields", useDefineForClassFields ? trueType : falseType, 8 /* Readonly */)
|
|
46463
|
-
]);
|
|
46464
|
-
globals.set(typeScriptSettingsSymbol.escapedName, typeScriptSettingsSymbol);
|
|
46465
46423
|
initializeTypeChecker();
|
|
46466
46424
|
return checker;
|
|
46467
46425
|
function getCachedType(key) {
|
|
@@ -46636,8 +46594,8 @@ function createTypeChecker(host) {
|
|
|
46636
46594
|
symbol.links.type = type;
|
|
46637
46595
|
return symbol;
|
|
46638
46596
|
}
|
|
46639
|
-
function createProperty(name, type
|
|
46640
|
-
const symbol = createSymbol(4 /* Property */, name
|
|
46597
|
+
function createProperty(name, type) {
|
|
46598
|
+
const symbol = createSymbol(4 /* Property */, name);
|
|
46641
46599
|
symbol.links.type = type;
|
|
46642
46600
|
return symbol;
|
|
46643
46601
|
}
|
|
@@ -46819,9 +46777,9 @@ function createTypeChecker(host) {
|
|
|
46819
46777
|
});
|
|
46820
46778
|
}
|
|
46821
46779
|
function mergeModuleAugmentation(moduleName) {
|
|
46822
|
-
var
|
|
46780
|
+
var _a, _b, _c;
|
|
46823
46781
|
const moduleAugmentation = moduleName.parent;
|
|
46824
|
-
if (((
|
|
46782
|
+
if (((_a = moduleAugmentation.symbol.declarations) == null ? void 0 : _a[0]) !== moduleAugmentation) {
|
|
46825
46783
|
Debug.assert(moduleAugmentation.symbol.declarations.length > 1);
|
|
46826
46784
|
return;
|
|
46827
46785
|
}
|
|
@@ -47134,7 +47092,7 @@ function createTypeChecker(host) {
|
|
|
47134
47092
|
}
|
|
47135
47093
|
function onSuccessfullyResolvedSymbol(errorLocation, result, meaning, lastLocation, associatedDeclarationForContainingInitializerOrBindingName, withinDeferredContext) {
|
|
47136
47094
|
addLazyDiagnostic(() => {
|
|
47137
|
-
var
|
|
47095
|
+
var _a;
|
|
47138
47096
|
const name = result.escapedName;
|
|
47139
47097
|
const isInExternalModule = lastLocation && isSourceFile(lastLocation) && isExternalOrCommonJsModule(lastLocation);
|
|
47140
47098
|
if (errorLocation && (meaning & 2 /* BlockScopedVariable */ || (meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 111551 /* Value */) === 111551 /* Value */)) {
|
|
@@ -47174,7 +47132,7 @@ function createTypeChecker(host) {
|
|
|
47174
47132
|
const isGlobal = getSymbol(globals, name, meaning) === result;
|
|
47175
47133
|
const nonValueSymbol = isGlobal && isSourceFile(lastLocation) && lastLocation.locals && getSymbol(lastLocation.locals, name, ~111551 /* Value */);
|
|
47176
47134
|
if (nonValueSymbol) {
|
|
47177
|
-
const importDecl = (
|
|
47135
|
+
const importDecl = (_a = nonValueSymbol.declarations) == null ? void 0 : _a.find((d) => d.kind === 276 /* ImportSpecifier */ || d.kind === 273 /* ImportClause */ || d.kind === 274 /* NamespaceImport */ || d.kind === 271 /* ImportEqualsDeclaration */);
|
|
47178
47136
|
if (importDecl && !isTypeOnlyImportDeclaration(importDecl)) {
|
|
47179
47137
|
error(importDecl, Diagnostics.Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled, unescapeLeadingUnderscores(name));
|
|
47180
47138
|
}
|
|
@@ -47425,12 +47383,12 @@ function createTypeChecker(host) {
|
|
|
47425
47383
|
return false;
|
|
47426
47384
|
}
|
|
47427
47385
|
function checkResolvedBlockScopedVariable(result, errorLocation) {
|
|
47428
|
-
var
|
|
47386
|
+
var _a;
|
|
47429
47387
|
Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */));
|
|
47430
47388
|
if (result.flags & (16 /* Function */ | 1 /* FunctionScopedVariable */ | 67108864 /* Assignment */) && result.flags & 32 /* Class */) {
|
|
47431
47389
|
return;
|
|
47432
47390
|
}
|
|
47433
|
-
const declaration = (
|
|
47391
|
+
const declaration = (_a = result.declarations) == null ? void 0 : _a.find(
|
|
47434
47392
|
(d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 266 /* EnumDeclaration */
|
|
47435
47393
|
);
|
|
47436
47394
|
if (declaration === void 0)
|
|
@@ -47612,14 +47570,14 @@ function createTypeChecker(host) {
|
|
|
47612
47570
|
}
|
|
47613
47571
|
}
|
|
47614
47572
|
function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) {
|
|
47615
|
-
var
|
|
47573
|
+
var _a;
|
|
47616
47574
|
let exportDefaultSymbol;
|
|
47617
47575
|
if (isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
47618
47576
|
exportDefaultSymbol = moduleSymbol;
|
|
47619
47577
|
} else {
|
|
47620
47578
|
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
|
|
47621
47579
|
}
|
|
47622
|
-
const file = (
|
|
47580
|
+
const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
47623
47581
|
const specifier = getModuleSpecifierForImportOrExport(node);
|
|
47624
47582
|
if (!specifier) {
|
|
47625
47583
|
return exportDefaultSymbol;
|
|
@@ -47685,8 +47643,8 @@ function createTypeChecker(host) {
|
|
|
47685
47643
|
}
|
|
47686
47644
|
}
|
|
47687
47645
|
function reportNonDefaultExport(moduleSymbol, node) {
|
|
47688
|
-
var
|
|
47689
|
-
if ((
|
|
47646
|
+
var _a, _b, _c;
|
|
47647
|
+
if ((_a = moduleSymbol.exports) == null ? void 0 : _a.has(node.symbol.escapedName)) {
|
|
47690
47648
|
error(
|
|
47691
47649
|
node.name,
|
|
47692
47650
|
Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,
|
|
@@ -47699,8 +47657,8 @@ function createTypeChecker(host) {
|
|
|
47699
47657
|
if (exportStar) {
|
|
47700
47658
|
const defaultExport = (_c = exportStar.declarations) == null ? void 0 : _c.find(
|
|
47701
47659
|
(decl) => {
|
|
47702
|
-
var
|
|
47703
|
-
return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (
|
|
47660
|
+
var _a2, _b2;
|
|
47661
|
+
return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (_a2 = resolveExternalModuleName(decl, decl.moduleSpecifier)) == null ? void 0 : _a2.exports) == null ? void 0 : _b2.has("default" /* Default */)));
|
|
47704
47662
|
}
|
|
47705
47663
|
);
|
|
47706
47664
|
if (defaultExport) {
|
|
@@ -47767,11 +47725,11 @@ function createTypeChecker(host) {
|
|
|
47767
47725
|
return result;
|
|
47768
47726
|
}
|
|
47769
47727
|
function getExportOfModule(symbol, name, specifier, dontResolveAlias) {
|
|
47770
|
-
var
|
|
47728
|
+
var _a;
|
|
47771
47729
|
if (symbol.flags & 1536 /* Module */) {
|
|
47772
47730
|
const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText);
|
|
47773
47731
|
const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
|
|
47774
|
-
const exportStarDeclaration = (
|
|
47732
|
+
const exportStarDeclaration = (_a = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a.get(name.escapedText);
|
|
47775
47733
|
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
47776
47734
|
specifier,
|
|
47777
47735
|
exportSymbol,
|
|
@@ -47793,7 +47751,7 @@ function createTypeChecker(host) {
|
|
|
47793
47751
|
}
|
|
47794
47752
|
}
|
|
47795
47753
|
function getExternalModuleMember(node, specifier, dontResolveAlias = false) {
|
|
47796
|
-
var
|
|
47754
|
+
var _a;
|
|
47797
47755
|
const moduleSpecifier = getExternalModuleRequireArgument(node) || node.moduleSpecifier;
|
|
47798
47756
|
const moduleSymbol = resolveExternalModuleName(node, moduleSpecifier);
|
|
47799
47757
|
const name = !isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name;
|
|
@@ -47827,7 +47785,7 @@ function createTypeChecker(host) {
|
|
|
47827
47785
|
symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);
|
|
47828
47786
|
let symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
|
|
47829
47787
|
if (symbolFromModule === void 0 && name.escapedText === "default" /* Default */) {
|
|
47830
|
-
const file = (
|
|
47788
|
+
const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
47831
47789
|
if (isOnlyImportableAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
47832
47790
|
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
47833
47791
|
}
|
|
@@ -47841,7 +47799,7 @@ function createTypeChecker(host) {
|
|
|
47841
47799
|
}
|
|
47842
47800
|
}
|
|
47843
47801
|
function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) {
|
|
47844
|
-
var
|
|
47802
|
+
var _a;
|
|
47845
47803
|
const moduleName = getFullyQualifiedName(moduleSymbol, node);
|
|
47846
47804
|
const declarationName = declarationNameToString(name);
|
|
47847
47805
|
const suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
@@ -47852,7 +47810,7 @@ function createTypeChecker(host) {
|
|
|
47852
47810
|
addRelatedInfo(diagnostic, createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName));
|
|
47853
47811
|
}
|
|
47854
47812
|
} else {
|
|
47855
|
-
if ((
|
|
47813
|
+
if ((_a = moduleSymbol.exports) == null ? void 0 : _a.has("default" /* Default */)) {
|
|
47856
47814
|
error(
|
|
47857
47815
|
name,
|
|
47858
47816
|
Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,
|
|
@@ -47865,8 +47823,8 @@ function createTypeChecker(host) {
|
|
|
47865
47823
|
}
|
|
47866
47824
|
}
|
|
47867
47825
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
47868
|
-
var
|
|
47869
|
-
const localSymbol = (_b = (
|
|
47826
|
+
var _a, _b;
|
|
47827
|
+
const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name.escapedText);
|
|
47870
47828
|
const exports2 = moduleSymbol.exports;
|
|
47871
47829
|
if (localSymbol) {
|
|
47872
47830
|
const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
|
|
@@ -48133,9 +48091,9 @@ function createTypeChecker(host) {
|
|
|
48133
48091
|
return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty);
|
|
48134
48092
|
}
|
|
48135
48093
|
function markSymbolOfAliasDeclarationIfTypeOnlyWorker(aliasDeclarationLinks, target, overwriteEmpty) {
|
|
48136
|
-
var
|
|
48094
|
+
var _a;
|
|
48137
48095
|
if (target && (aliasDeclarationLinks.typeOnlyDeclaration === void 0 || overwriteEmpty && aliasDeclarationLinks.typeOnlyDeclaration === false)) {
|
|
48138
|
-
const exportSymbol = ((
|
|
48096
|
+
const exportSymbol = ((_a = target.exports) == null ? void 0 : _a.get("export=" /* ExportEquals */)) ?? target;
|
|
48139
48097
|
const typeOnly = exportSymbol.declarations && find(exportSymbol.declarations, isTypeOnlyImportOrExportDeclaration);
|
|
48140
48098
|
aliasDeclarationLinks.typeOnlyDeclaration = typeOnly ?? getSymbolLinks(exportSymbol).typeOnlyDeclaration ?? false;
|
|
48141
48099
|
}
|
|
@@ -48432,7 +48390,7 @@ function createTypeChecker(host) {
|
|
|
48432
48390
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
48433
48391
|
}
|
|
48434
48392
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
48435
|
-
var
|
|
48393
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
48436
48394
|
if (startsWith(moduleReference, "@types/")) {
|
|
48437
48395
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
48438
48396
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -48447,13 +48405,13 @@ function createTypeChecker(host) {
|
|
|
48447
48405
|
return ambientModule;
|
|
48448
48406
|
}
|
|
48449
48407
|
const currentSourceFile = getSourceFileOfNode(location);
|
|
48450
|
-
const contextSpecifier = isStringLiteralLike(location) ? location : ((
|
|
48408
|
+
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isInJSFile(location) && isJSDocImportTag(location) ? location.moduleSpecifier : void 0) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
|
|
48451
48409
|
location.initializer,
|
|
48452
48410
|
/*requireStringLiteralLikeArgument*/
|
|
48453
48411
|
true
|
|
48454
48412
|
) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, isImportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression) || ((_f = findAncestor(location, isExportDeclaration)) == null ? void 0 : _f.moduleSpecifier);
|
|
48455
48413
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
|
|
48456
|
-
const
|
|
48414
|
+
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
48457
48415
|
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
48458
48416
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
48459
48417
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
@@ -48489,7 +48447,7 @@ function createTypeChecker(host) {
|
|
|
48489
48447
|
moduleReference
|
|
48490
48448
|
);
|
|
48491
48449
|
}
|
|
48492
|
-
if (
|
|
48450
|
+
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
48493
48451
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
48494
48452
|
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
48495
48453
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
@@ -48593,8 +48551,8 @@ function createTypeChecker(host) {
|
|
|
48593
48551
|
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
48594
48552
|
} else {
|
|
48595
48553
|
const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference);
|
|
48596
|
-
const resolutionIsNode16OrNext =
|
|
48597
|
-
if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) &&
|
|
48554
|
+
const resolutionIsNode16OrNext = moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */;
|
|
48555
|
+
if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
48598
48556
|
error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
48599
48557
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
48600
48558
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
@@ -48680,7 +48638,7 @@ function createTypeChecker(host) {
|
|
|
48680
48638
|
return links.cjsExportMerged = merged;
|
|
48681
48639
|
}
|
|
48682
48640
|
function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) {
|
|
48683
|
-
var
|
|
48641
|
+
var _a;
|
|
48684
48642
|
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
|
|
48685
48643
|
if (!dontResolveAlias && symbol) {
|
|
48686
48644
|
if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 307 /* SourceFile */)) {
|
|
@@ -48696,7 +48654,7 @@ function createTypeChecker(host) {
|
|
|
48696
48654
|
if (defaultOnlyType) {
|
|
48697
48655
|
return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
|
|
48698
48656
|
}
|
|
48699
|
-
const targetFile = (
|
|
48657
|
+
const targetFile = (_a = moduleSymbol == null ? void 0 : moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
48700
48658
|
const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getEmitSyntaxForModuleSpecifierExpression(reference), host.getImpliedNodeFormatForEmit(targetFile));
|
|
48701
48659
|
if (getESModuleInterop(compilerOptions) || isEsmCjsRef) {
|
|
48702
48660
|
let sigs = getSignaturesOfStructuredType(type, 0 /* Call */);
|
|
@@ -48905,8 +48863,8 @@ function createTypeChecker(host) {
|
|
|
48905
48863
|
return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));
|
|
48906
48864
|
}
|
|
48907
48865
|
function getFunctionExpressionParentSymbolOrSymbol(symbol) {
|
|
48908
|
-
var
|
|
48909
|
-
return ((
|
|
48866
|
+
var _a, _b;
|
|
48867
|
+
return ((_a = symbol.valueDeclaration) == null ? void 0 : _a.kind) === 219 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 218 /* FunctionExpression */ ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol;
|
|
48910
48868
|
}
|
|
48911
48869
|
function getAlternativeContainingModules(symbol, enclosingDeclaration) {
|
|
48912
48870
|
const containingFile = getSourceFileOfNode(enclosingDeclaration);
|
|
@@ -49060,11 +49018,11 @@ function createTypeChecker(host) {
|
|
|
49060
49018
|
return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551 /* Value */);
|
|
49061
49019
|
}
|
|
49062
49020
|
function createType(flags) {
|
|
49063
|
-
var
|
|
49021
|
+
var _a;
|
|
49064
49022
|
const result = new Type7(checker, flags);
|
|
49065
49023
|
typeCount++;
|
|
49066
49024
|
result.id = typeCount;
|
|
49067
|
-
(
|
|
49025
|
+
(_a = tracing) == null ? void 0 : _a.recordType(result);
|
|
49068
49026
|
return result;
|
|
49069
49027
|
}
|
|
49070
49028
|
function createTypeWithSymbol(flags, symbol) {
|
|
@@ -49483,7 +49441,7 @@ function createTypeChecker(host) {
|
|
|
49483
49441
|
}
|
|
49484
49442
|
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible };
|
|
49485
49443
|
function getIsDeclarationVisible(declaration) {
|
|
49486
|
-
var
|
|
49444
|
+
var _a, _b;
|
|
49487
49445
|
if (!isDeclarationVisible(declaration)) {
|
|
49488
49446
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
49489
49447
|
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
@@ -49495,7 +49453,7 @@ function createTypeChecker(host) {
|
|
|
49495
49453
|
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration, 32 /* Export */) && isDeclarationVisible(declaration.parent)) {
|
|
49496
49454
|
return addVisibleAlias(declaration, declaration);
|
|
49497
49455
|
} else if (isBindingElement(declaration)) {
|
|
49498
|
-
if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((
|
|
49456
|
+
if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent, 32 /* Export */) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) {
|
|
49499
49457
|
return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
|
|
49500
49458
|
} else if (symbol.flags & 2 /* BlockScopedVariable */) {
|
|
49501
49459
|
const variableStatement = findAncestor(declaration, isVariableStatement);
|
|
@@ -49814,7 +49772,7 @@ function createTypeChecker(host) {
|
|
|
49814
49772
|
return typeNode;
|
|
49815
49773
|
}
|
|
49816
49774
|
function typeToTypeNodeWorker(type, context) {
|
|
49817
|
-
var
|
|
49775
|
+
var _a, _b;
|
|
49818
49776
|
if (cancellationToken && cancellationToken.throwIfCancellationRequested) {
|
|
49819
49777
|
cancellationToken.throwIfCancellationRequested();
|
|
49820
49778
|
}
|
|
@@ -49948,7 +49906,7 @@ function createTypeChecker(host) {
|
|
|
49948
49906
|
if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) {
|
|
49949
49907
|
context.encounteredError = true;
|
|
49950
49908
|
}
|
|
49951
|
-
(_b = (
|
|
49909
|
+
(_b = (_a = context.tracker).reportInaccessibleThisError) == null ? void 0 : _b.call(_a);
|
|
49952
49910
|
}
|
|
49953
49911
|
context.approximateLength += 4;
|
|
49954
49912
|
return factory.createThisTypeNode();
|
|
@@ -50113,9 +50071,9 @@ function createTypeChecker(host) {
|
|
|
50113
50071
|
return factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
|
|
50114
50072
|
}
|
|
50115
50073
|
function typeToTypeNodeOrCircularityElision(type2) {
|
|
50116
|
-
var
|
|
50074
|
+
var _a2, _b2, _c;
|
|
50117
50075
|
if (type2.flags & 1048576 /* Union */) {
|
|
50118
|
-
if ((
|
|
50076
|
+
if ((_a2 = context.visitedTypes) == null ? void 0 : _a2.has(getTypeId(type2))) {
|
|
50119
50077
|
if (!(context.flags & 131072 /* AllowAnonymousIdentifier */)) {
|
|
50120
50078
|
context.encounteredError = true;
|
|
50121
50079
|
(_c = (_b2 = context.tracker) == null ? void 0 : _b2.reportCyclicStructureError) == null ? void 0 : _c.call(_b2);
|
|
@@ -50133,13 +50091,13 @@ function createTypeChecker(host) {
|
|
|
50133
50091
|
return !!type2.target && isMappedTypeHomomorphic(type2.target) && !isMappedTypeHomomorphic(type2);
|
|
50134
50092
|
}
|
|
50135
50093
|
function createMappedTypeNodeFromType(type2) {
|
|
50136
|
-
var
|
|
50094
|
+
var _a2;
|
|
50137
50095
|
Debug.assert(!!(type2.flags & 524288 /* Object */));
|
|
50138
50096
|
const readonlyToken = type2.declaration.readonlyToken ? factory.createToken(type2.declaration.readonlyToken.kind) : void 0;
|
|
50139
50097
|
const questionToken = type2.declaration.questionToken ? factory.createToken(type2.declaration.questionToken.kind) : void 0;
|
|
50140
50098
|
let appropriateConstraintTypeNode;
|
|
50141
50099
|
let newTypeVariable;
|
|
50142
|
-
const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((
|
|
50100
|
+
const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((_a2 = getConstraintOfTypeParameter(getConstraintTypeFromMappedType(type2))) == null ? void 0 : _a2.flags) & 4194304 /* Index */);
|
|
50143
50101
|
if (isMappedTypeWithKeyofConstraintDeclaration(type2)) {
|
|
50144
50102
|
if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type2) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
50145
50103
|
const newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T"));
|
|
@@ -50198,7 +50156,7 @@ function createTypeChecker(host) {
|
|
|
50198
50156
|
return result;
|
|
50199
50157
|
}
|
|
50200
50158
|
function createAnonymousTypeNode(type2) {
|
|
50201
|
-
var
|
|
50159
|
+
var _a2, _b2;
|
|
50202
50160
|
const typeId = type2.id;
|
|
50203
50161
|
const symbol = type2.symbol;
|
|
50204
50162
|
if (symbol) {
|
|
@@ -50212,7 +50170,7 @@ function createTypeChecker(host) {
|
|
|
50212
50170
|
return typeNode;
|
|
50213
50171
|
}
|
|
50214
50172
|
}
|
|
50215
|
-
if ((
|
|
50173
|
+
if ((_a2 = context.visitedTypes) == null ? void 0 : _a2.has(typeId)) {
|
|
50216
50174
|
return createElidedInformationPlaceholder(context);
|
|
50217
50175
|
}
|
|
50218
50176
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
@@ -50242,19 +50200,19 @@ function createTypeChecker(host) {
|
|
|
50242
50200
|
return createTypeNodeFromObjectType(type2);
|
|
50243
50201
|
}
|
|
50244
50202
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
50245
|
-
var
|
|
50203
|
+
var _a3;
|
|
50246
50204
|
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
|
|
50247
50205
|
some(symbol.declarations, (declaration) => isStatic(declaration));
|
|
50248
50206
|
const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
|
|
50249
50207
|
forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */));
|
|
50250
50208
|
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
|
|
50251
|
-
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((
|
|
50209
|
+
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId))) && // it is type of the symbol uses itself recursively
|
|
50252
50210
|
(!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
|
|
50253
50211
|
}
|
|
50254
50212
|
}
|
|
50255
50213
|
}
|
|
50256
50214
|
function visitAndTransformType(type2, transform) {
|
|
50257
|
-
var
|
|
50215
|
+
var _a2, _b2, _c;
|
|
50258
50216
|
const typeId = type2.id;
|
|
50259
50217
|
const isConstructorObject = getObjectFlags(type2) & 16 /* Anonymous */ && type2.symbol && type2.symbol.flags & 32 /* Class */;
|
|
50260
50218
|
const id = getObjectFlags(type2) & 4 /* Reference */ && type2.node ? "N" + getNodeId(type2.node) : type2.flags & 16777216 /* Conditional */ ? "N" + getNodeId(type2.root.node) : type2.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type2.symbol) : void 0;
|
|
@@ -50269,7 +50227,7 @@ function createTypeChecker(host) {
|
|
|
50269
50227
|
if (links) {
|
|
50270
50228
|
links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map());
|
|
50271
50229
|
}
|
|
50272
|
-
const cachedResult = (
|
|
50230
|
+
const cachedResult = (_a2 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _a2.get(key);
|
|
50273
50231
|
if (cachedResult) {
|
|
50274
50232
|
(_b2 = cachedResult.trackedSymbols) == null ? void 0 : _b2.forEach(
|
|
50275
50233
|
([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol(
|
|
@@ -50588,11 +50546,11 @@ function createTypeChecker(host) {
|
|
|
50588
50546
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
50589
50547
|
}
|
|
50590
50548
|
function shouldUsePlaceholderForProperty(propertySymbol, context) {
|
|
50591
|
-
var
|
|
50592
|
-
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((
|
|
50549
|
+
var _a;
|
|
50550
|
+
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((_a = context.reverseMappedStack) == null ? void 0 : _a[0]) && !(getObjectFlags(last(context.reverseMappedStack).links.propertyType) & 16 /* Anonymous */));
|
|
50593
50551
|
}
|
|
50594
50552
|
function addPropertyToElementList(propertySymbol, context, typeElements) {
|
|
50595
|
-
var
|
|
50553
|
+
var _a;
|
|
50596
50554
|
const propertyIsReverseMapped = !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */);
|
|
50597
50555
|
const propertyType = shouldUsePlaceholderForProperty(propertySymbol, context) ? anyType : getNonMissingTypeOfSymbol(propertySymbol);
|
|
50598
50556
|
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
@@ -50614,7 +50572,7 @@ function createTypeChecker(host) {
|
|
|
50614
50572
|
context.tracker.reportNonSerializableProperty(symbolToString(propertySymbol));
|
|
50615
50573
|
}
|
|
50616
50574
|
}
|
|
50617
|
-
context.enclosingDeclaration = propertySymbol.valueDeclaration || ((
|
|
50575
|
+
context.enclosingDeclaration = propertySymbol.valueDeclaration || ((_a = propertySymbol.declarations) == null ? void 0 : _a[0]) || saveEnclosingDeclaration;
|
|
50618
50576
|
const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
|
|
50619
50577
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
50620
50578
|
context.approximateLength += symbolName(propertySymbol).length + 1;
|
|
@@ -50682,8 +50640,8 @@ function createTypeChecker(host) {
|
|
|
50682
50640
|
);
|
|
50683
50641
|
typeElements.push(preserveCommentsOn(propertySignature));
|
|
50684
50642
|
function preserveCommentsOn(node) {
|
|
50685
|
-
var
|
|
50686
|
-
const jsdocPropertyTag = (
|
|
50643
|
+
var _a2;
|
|
50644
|
+
const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 348 /* JSDocPropertyTag */);
|
|
50687
50645
|
if (jsdocPropertyTag) {
|
|
50688
50646
|
const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment);
|
|
50689
50647
|
if (commentText) {
|
|
@@ -50790,7 +50748,7 @@ function createTypeChecker(host) {
|
|
|
50790
50748
|
);
|
|
50791
50749
|
}
|
|
50792
50750
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
50793
|
-
var
|
|
50751
|
+
var _a;
|
|
50794
50752
|
const flags = context.flags;
|
|
50795
50753
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
50796
50754
|
context.approximateLength += 3;
|
|
@@ -50880,7 +50838,7 @@ function createTypeChecker(host) {
|
|
|
50880
50838
|
if (typeArguments) {
|
|
50881
50839
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
50882
50840
|
}
|
|
50883
|
-
if (((
|
|
50841
|
+
if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 323 /* JSDocSignature */ && signature.declaration.parent.kind === 339 /* JSDocOverloadTag */) {
|
|
50884
50842
|
const comment = getTextOfNode(
|
|
50885
50843
|
signature.declaration.parent.parent,
|
|
50886
50844
|
/*includeTrivia*/
|
|
@@ -51212,11 +51170,11 @@ function createTypeChecker(host) {
|
|
|
51212
51170
|
return typeParameterNodes;
|
|
51213
51171
|
}
|
|
51214
51172
|
function lookupTypeParameterNodes(chain, index, context) {
|
|
51215
|
-
var
|
|
51173
|
+
var _a;
|
|
51216
51174
|
Debug.assert(chain && 0 <= index && index < chain.length);
|
|
51217
51175
|
const symbol = chain[index];
|
|
51218
51176
|
const symbolId = getSymbolId(symbol);
|
|
51219
|
-
if ((
|
|
51177
|
+
if ((_a = context.typeParameterSymbolList) == null ? void 0 : _a.has(symbolId)) {
|
|
51220
51178
|
return void 0;
|
|
51221
51179
|
}
|
|
51222
51180
|
(context.typeParameterSymbolList || (context.typeParameterSymbolList = /* @__PURE__ */ new Set())).add(symbolId);
|
|
@@ -51451,7 +51409,7 @@ function createTypeChecker(host) {
|
|
|
51451
51409
|
return false;
|
|
51452
51410
|
}
|
|
51453
51411
|
function typeParameterToName(type, context) {
|
|
51454
|
-
var
|
|
51412
|
+
var _a, _b;
|
|
51455
51413
|
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && context.typeParameterNames) {
|
|
51456
51414
|
const cached = context.typeParameterNames.get(getTypeId(type));
|
|
51457
51415
|
if (cached) {
|
|
@@ -51470,7 +51428,7 @@ function createTypeChecker(host) {
|
|
|
51470
51428
|
}
|
|
51471
51429
|
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
51472
51430
|
const rawtext = result.escapedText;
|
|
51473
|
-
let i = ((
|
|
51431
|
+
let i = ((_a = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a.get(rawtext)) || 0;
|
|
51474
51432
|
let text = rawtext;
|
|
51475
51433
|
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsOtherTypeParameterInScope(text, context, type)) {
|
|
51476
51434
|
i++;
|
|
@@ -51646,7 +51604,7 @@ function createTypeChecker(host) {
|
|
|
51646
51604
|
return enclosingDeclaration;
|
|
51647
51605
|
}
|
|
51648
51606
|
function serializeTypeForDeclaration(context, declaration, type, symbol) {
|
|
51649
|
-
var
|
|
51607
|
+
var _a;
|
|
51650
51608
|
const addUndefined = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration);
|
|
51651
51609
|
const enclosingDeclaration = context.enclosingDeclaration;
|
|
51652
51610
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
@@ -51663,7 +51621,7 @@ function createTypeChecker(host) {
|
|
|
51663
51621
|
if (type.flags & 8192 /* UniqueESSymbol */ && type.symbol === symbol && (!context.enclosingDeclaration || some(symbol.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)))) {
|
|
51664
51622
|
context.flags |= 1048576 /* AllowUniqueESSymbolType */;
|
|
51665
51623
|
}
|
|
51666
|
-
const decl = declaration ?? symbol.valueDeclaration ?? ((
|
|
51624
|
+
const decl = declaration ?? symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]);
|
|
51667
51625
|
const expr = decl && isDeclarationWithPossibleInnerTypeNodeReuse(decl) ? getPossibleTypeNodeReuseExpression(decl) : void 0;
|
|
51668
51626
|
if (decl && hasInferredType(decl) && !(context.flags & -2147483648 /* NoSyntacticPrinter */)) {
|
|
51669
51627
|
syntacticNodeBuilder.serializeTypeOfDeclaration(decl, context);
|
|
@@ -52024,7 +51982,7 @@ function createTypeChecker(host) {
|
|
|
52024
51982
|
}
|
|
52025
51983
|
}
|
|
52026
51984
|
function symbolTableToDeclarationStatements(symbolTable, context) {
|
|
52027
|
-
var
|
|
51985
|
+
var _a;
|
|
52028
51986
|
const serializePropertySymbolForClass = makeSerializePropertySymbol(
|
|
52029
51987
|
factory.createPropertyDeclaration,
|
|
52030
51988
|
174 /* MethodDeclaration */,
|
|
@@ -52046,14 +52004,14 @@ function createTypeChecker(host) {
|
|
|
52046
52004
|
...oldcontext,
|
|
52047
52005
|
usedSymbolNames: new Set(oldcontext.usedSymbolNames),
|
|
52048
52006
|
remappedSymbolNames: /* @__PURE__ */ new Map(),
|
|
52049
|
-
remappedSymbolReferences: new Map((
|
|
52007
|
+
remappedSymbolReferences: new Map((_a = oldcontext.remappedSymbolReferences) == null ? void 0 : _a.entries()),
|
|
52050
52008
|
tracker: void 0
|
|
52051
52009
|
};
|
|
52052
52010
|
const tracker = {
|
|
52053
52011
|
...oldcontext.tracker.inner,
|
|
52054
52012
|
trackSymbol: (sym, decl, meaning) => {
|
|
52055
|
-
var
|
|
52056
|
-
if ((
|
|
52013
|
+
var _a2, _b;
|
|
52014
|
+
if ((_a2 = context.remappedSymbolNames) == null ? void 0 : _a2.has(getSymbolId(sym)))
|
|
52057
52015
|
return false;
|
|
52058
52016
|
const accessibleResult = isSymbolAccessible(
|
|
52059
52017
|
sym,
|
|
@@ -52288,7 +52246,7 @@ function createTypeChecker(host) {
|
|
|
52288
52246
|
}
|
|
52289
52247
|
}
|
|
52290
52248
|
function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) {
|
|
52291
|
-
var
|
|
52249
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
52292
52250
|
const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName);
|
|
52293
52251
|
const isDefault = escapedSymbolName === "default" /* Default */;
|
|
52294
52252
|
if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) {
|
|
@@ -52319,7 +52277,7 @@ function createTypeChecker(host) {
|
|
|
52319
52277
|
} else {
|
|
52320
52278
|
const type = getTypeOfSymbol(symbol);
|
|
52321
52279
|
const localName = getInternalSymbolName(symbol, symbolName2);
|
|
52322
|
-
if (type.symbol && type.symbol !== symbol && type.symbol.flags & 16 /* Function */ && some(type.symbol.declarations, isFunctionExpressionOrArrowFunction) && (((
|
|
52280
|
+
if (type.symbol && type.symbol !== symbol && type.symbol.flags & 16 /* Function */ && some(type.symbol.declarations, isFunctionExpressionOrArrowFunction) && (((_a2 = type.symbol.members) == null ? void 0 : _a2.size) || ((_b = type.symbol.exports) == null ? void 0 : _b.size))) {
|
|
52323
52281
|
if (!context.remappedSymbolReferences) {
|
|
52324
52282
|
context.remappedSymbolReferences = /* @__PURE__ */ new Map();
|
|
52325
52283
|
}
|
|
@@ -52498,11 +52456,11 @@ function createTypeChecker(host) {
|
|
|
52498
52456
|
results.push(node);
|
|
52499
52457
|
}
|
|
52500
52458
|
function serializeTypeAlias(symbol, symbolName2, modifierFlags) {
|
|
52501
|
-
var
|
|
52459
|
+
var _a2;
|
|
52502
52460
|
const aliasType = getDeclaredTypeOfTypeAlias(symbol);
|
|
52503
52461
|
const typeParams = getSymbolLinks(symbol).typeParameters;
|
|
52504
52462
|
const typeParamDecls = map(typeParams, (p) => typeParameterToDeclaration(p, context));
|
|
52505
|
-
const jsdocAliasDecl = (
|
|
52463
|
+
const jsdocAliasDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isJSDocTypeAlias);
|
|
52506
52464
|
const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0);
|
|
52507
52465
|
const oldFlags = context.flags;
|
|
52508
52466
|
context.flags |= 8388608 /* InTypeAlias */;
|
|
@@ -52589,12 +52547,12 @@ function createTypeChecker(host) {
|
|
|
52589
52547
|
/*isTypeOnly*/
|
|
52590
52548
|
false,
|
|
52591
52549
|
factory.createNamedExports(mapDefined(filter(mergedMembers, (n) => n.escapedName !== "export=" /* ExportEquals */), (s) => {
|
|
52592
|
-
var
|
|
52550
|
+
var _a2, _b;
|
|
52593
52551
|
const name = unescapeLeadingUnderscores(s.escapedName);
|
|
52594
52552
|
const localName2 = getInternalSymbolName(s, name);
|
|
52595
52553
|
const aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s);
|
|
52596
52554
|
if (containingFile && (aliasDecl ? containingFile !== getSourceFileOfNode(aliasDecl) : !some(s.declarations, (d) => getSourceFileOfNode(d) === containingFile))) {
|
|
52597
|
-
(_b = (
|
|
52555
|
+
(_b = (_a2 = context.tracker) == null ? void 0 : _a2.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a2, containingFile, symbol, s);
|
|
52598
52556
|
return void 0;
|
|
52599
52557
|
}
|
|
52600
52558
|
const target = aliasDecl && getTargetOfAliasDeclaration(
|
|
@@ -52760,8 +52718,8 @@ function createTypeChecker(host) {
|
|
|
52760
52718
|
return void 0;
|
|
52761
52719
|
}
|
|
52762
52720
|
function serializeAsClass(symbol, localName, modifierFlags) {
|
|
52763
|
-
var
|
|
52764
|
-
const originalDecl = (
|
|
52721
|
+
var _a2, _b;
|
|
52722
|
+
const originalDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike);
|
|
52765
52723
|
const oldEnclosing = context.enclosingDeclaration;
|
|
52766
52724
|
context.enclosingDeclaration = originalDecl || oldEnclosing;
|
|
52767
52725
|
const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
|
|
@@ -52858,7 +52816,7 @@ function createTypeChecker(host) {
|
|
|
52858
52816
|
});
|
|
52859
52817
|
}
|
|
52860
52818
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
52861
|
-
var
|
|
52819
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
52862
52820
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
52863
52821
|
if (!node)
|
|
52864
52822
|
return Debug.fail();
|
|
@@ -52878,7 +52836,7 @@ function createTypeChecker(host) {
|
|
|
52878
52836
|
includePrivateSymbol(target);
|
|
52879
52837
|
switch (node.kind) {
|
|
52880
52838
|
case 208 /* BindingElement */:
|
|
52881
|
-
if (((_b = (
|
|
52839
|
+
if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) {
|
|
52882
52840
|
const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
52883
52841
|
const { propertyName } = node;
|
|
52884
52842
|
addResult(
|
|
@@ -53101,7 +53059,7 @@ function createTypeChecker(host) {
|
|
|
53101
53059
|
);
|
|
53102
53060
|
}
|
|
53103
53061
|
function serializeMaybeAliasAssignment(symbol) {
|
|
53104
|
-
var
|
|
53062
|
+
var _a2;
|
|
53105
53063
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
53106
53064
|
return false;
|
|
53107
53065
|
}
|
|
@@ -53174,7 +53132,7 @@ function createTypeChecker(host) {
|
|
|
53174
53132
|
if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
|
|
53175
53133
|
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */);
|
|
53176
53134
|
} else {
|
|
53177
|
-
const flags = ((
|
|
53135
|
+
const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */;
|
|
53178
53136
|
const statement = factory.createVariableStatement(
|
|
53179
53137
|
/*modifiers*/
|
|
53180
53138
|
void 0,
|
|
@@ -53214,9 +53172,9 @@ function createTypeChecker(host) {
|
|
|
53214
53172
|
}
|
|
53215
53173
|
}
|
|
53216
53174
|
function isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, hostSymbol) {
|
|
53217
|
-
var
|
|
53175
|
+
var _a2;
|
|
53218
53176
|
const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
|
|
53219
|
-
return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !some((
|
|
53177
|
+
return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !some((_a2 = typeToSerialize.symbol) == null ? void 0 : _a2.declarations, isTypeNode) && // If the type comes straight from a type node, we shouldn't try to break it up
|
|
53220
53178
|
!length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
|
|
53221
53179
|
!!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK
|
|
53222
53180
|
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => {
|
|
@@ -53231,7 +53189,7 @@ function createTypeChecker(host) {
|
|
|
53231
53189
|
}
|
|
53232
53190
|
function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
|
|
53233
53191
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
53234
|
-
var
|
|
53192
|
+
var _a2, _b, _c, _d, _e;
|
|
53235
53193
|
const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
|
|
53236
53194
|
const isPrivate = !!(modifierFlags & 2 /* Private */);
|
|
53237
53195
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
@@ -53242,7 +53200,7 @@ function createTypeChecker(host) {
|
|
|
53242
53200
|
}
|
|
53243
53201
|
const flag = modifierFlags & ~1024 /* Async */ | (isStatic2 ? 256 /* Static */ : 0);
|
|
53244
53202
|
const name = getPropertyNameNodeForSymbol(p, context);
|
|
53245
|
-
const firstPropertyLikeDecl = (
|
|
53203
|
+
const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
|
|
53246
53204
|
if (p.flags & 98304 /* Accessor */ && useAccessors) {
|
|
53247
53205
|
const result = [];
|
|
53248
53206
|
if (p.flags & 65536 /* SetAccessor */) {
|
|
@@ -53511,7 +53469,7 @@ function createTypeChecker(host) {
|
|
|
53511
53469
|
}
|
|
53512
53470
|
}
|
|
53513
53471
|
function getUnusedName(input, symbol) {
|
|
53514
|
-
var
|
|
53472
|
+
var _a2, _b;
|
|
53515
53473
|
const id = symbol ? getSymbolId(symbol) : void 0;
|
|
53516
53474
|
if (id) {
|
|
53517
53475
|
if (context.remappedSymbolNames.has(id)) {
|
|
@@ -53523,7 +53481,7 @@ function createTypeChecker(host) {
|
|
|
53523
53481
|
}
|
|
53524
53482
|
let i = 0;
|
|
53525
53483
|
const original = input;
|
|
53526
|
-
while ((
|
|
53484
|
+
while ((_a2 = context.usedSymbolNames) == null ? void 0 : _a2.has(input)) {
|
|
53527
53485
|
i++;
|
|
53528
53486
|
input = `${original}_${i}`;
|
|
53529
53487
|
}
|
|
@@ -53647,8 +53605,8 @@ function createTypeChecker(host) {
|
|
|
53647
53605
|
}
|
|
53648
53606
|
}
|
|
53649
53607
|
function getNameOfSymbolAsWritten(symbol, context) {
|
|
53650
|
-
var
|
|
53651
|
-
if ((
|
|
53608
|
+
var _a;
|
|
53609
|
+
if ((_a = context == null ? void 0 : context.remappedSymbolReferences) == null ? void 0 : _a.has(getSymbolId(symbol))) {
|
|
53652
53610
|
symbol = context.remappedSymbolReferences.get(getSymbolId(symbol));
|
|
53653
53611
|
}
|
|
53654
53612
|
if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && // If it's not the first part of an entity name, it must print as `default`
|
|
@@ -53906,9 +53864,9 @@ function createTypeChecker(host) {
|
|
|
53906
53864
|
return prop ? getTypeOfSymbol(prop) : void 0;
|
|
53907
53865
|
}
|
|
53908
53866
|
function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
|
|
53909
|
-
var
|
|
53867
|
+
var _a;
|
|
53910
53868
|
let propType;
|
|
53911
|
-
return getTypeOfPropertyOfType(type, name) || (propType = (
|
|
53869
|
+
return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
|
|
53912
53870
|
propType,
|
|
53913
53871
|
/*isProperty*/
|
|
53914
53872
|
true,
|
|
@@ -54396,14 +54354,14 @@ function createTypeChecker(host) {
|
|
|
54396
54354
|
return widened;
|
|
54397
54355
|
}
|
|
54398
54356
|
function getJSContainerObjectType(decl, symbol, init) {
|
|
54399
|
-
var
|
|
54357
|
+
var _a, _b;
|
|
54400
54358
|
if (!isInJSFile(decl) || !init || !isObjectLiteralExpression(init) || init.properties.length) {
|
|
54401
54359
|
return void 0;
|
|
54402
54360
|
}
|
|
54403
54361
|
const exports2 = createSymbolTable();
|
|
54404
54362
|
while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
|
|
54405
54363
|
const s2 = getSymbolOfNode(decl);
|
|
54406
|
-
if ((
|
|
54364
|
+
if ((_a = s2 == null ? void 0 : s2.exports) == null ? void 0 : _a.size) {
|
|
54407
54365
|
mergeSymbolTable(exports2, s2.exports);
|
|
54408
54366
|
}
|
|
54409
54367
|
decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent;
|
|
@@ -54417,7 +54375,7 @@ function createTypeChecker(host) {
|
|
|
54417
54375
|
return type;
|
|
54418
54376
|
}
|
|
54419
54377
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
54420
|
-
var
|
|
54378
|
+
var _a;
|
|
54421
54379
|
const typeNode = getEffectiveTypeAnnotationNode(expression.parent);
|
|
54422
54380
|
if (typeNode) {
|
|
54423
54381
|
const type = getWidenedType(getTypeFromTypeNode(typeNode));
|
|
@@ -54433,7 +54391,7 @@ function createTypeChecker(host) {
|
|
|
54433
54391
|
);
|
|
54434
54392
|
}
|
|
54435
54393
|
}
|
|
54436
|
-
if ((
|
|
54394
|
+
if ((_a = symbol.parent) == null ? void 0 : _a.valueDeclaration) {
|
|
54437
54395
|
const possiblyAnnotatedSymbol = getFunctionExpressionParentSymbolOrSymbol(symbol.parent);
|
|
54438
54396
|
if (possiblyAnnotatedSymbol.valueDeclaration) {
|
|
54439
54397
|
const typeNode2 = getEffectiveTypeAnnotationNode(possiblyAnnotatedSymbol.valueDeclaration);
|
|
@@ -54487,13 +54445,13 @@ function createTypeChecker(host) {
|
|
|
54487
54445
|
resolvedSymbol.exports = createSymbolTable();
|
|
54488
54446
|
}
|
|
54489
54447
|
(resolvedSymbol || symbol).exports.forEach((s, name) => {
|
|
54490
|
-
var
|
|
54448
|
+
var _a;
|
|
54491
54449
|
const exportedMember = members.get(name);
|
|
54492
54450
|
if (exportedMember && exportedMember !== s && !(s.flags & 2097152 /* Alias */)) {
|
|
54493
54451
|
if (s.flags & 111551 /* Value */ && exportedMember.flags & 111551 /* Value */) {
|
|
54494
54452
|
if (s.valueDeclaration && exportedMember.valueDeclaration && getSourceFileOfNode(s.valueDeclaration) !== getSourceFileOfNode(exportedMember.valueDeclaration)) {
|
|
54495
54453
|
const unescapedName = unescapeLeadingUnderscores(s.escapedName);
|
|
54496
|
-
const exportedMemberName = ((
|
|
54454
|
+
const exportedMemberName = ((_a = tryCast(exportedMember.valueDeclaration, isNamedDeclaration)) == null ? void 0 : _a.name) || exportedMember.valueDeclaration;
|
|
54497
54455
|
addRelatedInfo(
|
|
54498
54456
|
error(s.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName),
|
|
54499
54457
|
createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here, unescapedName)
|
|
@@ -55166,11 +55124,8 @@ function createTypeChecker(host) {
|
|
|
55166
55124
|
}
|
|
55167
55125
|
}
|
|
55168
55126
|
function getOuterTypeParametersOfClassOrInterface(symbol) {
|
|
55169
|
-
var
|
|
55170
|
-
|
|
55171
|
-
return void 0;
|
|
55172
|
-
}
|
|
55173
|
-
const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
|
|
55127
|
+
var _a;
|
|
55128
|
+
const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a = symbol.declarations) == null ? void 0 : _a.find((decl) => {
|
|
55174
55129
|
if (decl.kind === 264 /* InterfaceDeclaration */) {
|
|
55175
55130
|
return true;
|
|
55176
55131
|
}
|
|
@@ -55491,13 +55446,13 @@ function createTypeChecker(host) {
|
|
|
55491
55446
|
return links.declaredType;
|
|
55492
55447
|
}
|
|
55493
55448
|
function getDeclaredTypeOfTypeAlias(symbol) {
|
|
55494
|
-
var
|
|
55449
|
+
var _a;
|
|
55495
55450
|
const links = getSymbolLinks(symbol);
|
|
55496
55451
|
if (!links.declaredType) {
|
|
55497
55452
|
if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) {
|
|
55498
55453
|
return errorType;
|
|
55499
55454
|
}
|
|
55500
|
-
const declaration = Debug.checkDefined((
|
|
55455
|
+
const declaration = Debug.checkDefined((_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias), "Type alias symbol with no valid declaration found");
|
|
55501
55456
|
const typeNode = isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type;
|
|
55502
55457
|
let type = typeNode ? getTypeFromTypeNode(typeNode) : errorType;
|
|
55503
55458
|
if (popTypeResolution()) {
|
|
@@ -56396,8 +56351,8 @@ function createTypeChecker(host) {
|
|
|
56396
56351
|
if (symbol === globalThisSymbol) {
|
|
56397
56352
|
const varsOnly = /* @__PURE__ */ new Map();
|
|
56398
56353
|
members.forEach((p) => {
|
|
56399
|
-
var
|
|
56400
|
-
if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((
|
|
56354
|
+
var _a;
|
|
56355
|
+
if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((_a = p.declarations) == null ? void 0 : _a.length) && every(p.declarations, isAmbientModule))) {
|
|
56401
56356
|
varsOnly.set(p.escapedName, p);
|
|
56402
56357
|
}
|
|
56403
56358
|
});
|
|
@@ -56633,7 +56588,7 @@ function createTypeChecker(host) {
|
|
|
56633
56588
|
}
|
|
56634
56589
|
}
|
|
56635
56590
|
function getTypeOfMappedSymbol(symbol) {
|
|
56636
|
-
var
|
|
56591
|
+
var _a;
|
|
56637
56592
|
if (!symbol.links.type) {
|
|
56638
56593
|
const mappedType = symbol.links.mappedType;
|
|
56639
56594
|
if (!pushTypeResolution(symbol, 0 /* Type */)) {
|
|
@@ -56652,7 +56607,7 @@ function createTypeChecker(host) {
|
|
|
56652
56607
|
error(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));
|
|
56653
56608
|
type = errorType;
|
|
56654
56609
|
}
|
|
56655
|
-
(
|
|
56610
|
+
(_a = symbol.links).type ?? (_a.type = type);
|
|
56656
56611
|
}
|
|
56657
56612
|
return symbol.links.type;
|
|
56658
56613
|
}
|
|
@@ -56851,8 +56806,8 @@ function createTypeChecker(host) {
|
|
|
56851
56806
|
return !!typeVariable && isConstTypeVariable(typeVariable, depth);
|
|
56852
56807
|
}
|
|
56853
56808
|
function isConstTypeVariable(type, depth = 0) {
|
|
56854
|
-
var
|
|
56855
|
-
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((
|
|
56809
|
+
var _a;
|
|
56810
|
+
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 4096 /* Const */)) || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isConstTypeVariable(t, depth)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType, depth + 1) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type), depth + 1) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType, depth) || getObjectFlags(type) & 32 /* Mapped */ && isConstMappedType(type, depth) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t, depth)) >= 0));
|
|
56856
56811
|
}
|
|
56857
56812
|
function getConstraintOfIndexedAccess(type) {
|
|
56858
56813
|
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
|
|
@@ -56951,7 +56906,7 @@ function createTypeChecker(host) {
|
|
|
56951
56906
|
}
|
|
56952
56907
|
}
|
|
56953
56908
|
return getNormalizedType(
|
|
56954
|
-
getIntersectionType(constraints),
|
|
56909
|
+
getIntersectionType(constraints, 2 /* NoConstraintReduction */),
|
|
56955
56910
|
/*writing*/
|
|
56956
56911
|
false
|
|
56957
56912
|
);
|
|
@@ -57143,7 +57098,7 @@ function createTypeChecker(host) {
|
|
|
57143
57098
|
return getReducedType(getApparentType(getReducedType(type)));
|
|
57144
57099
|
}
|
|
57145
57100
|
function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {
|
|
57146
|
-
var
|
|
57101
|
+
var _a, _b, _c;
|
|
57147
57102
|
let singleProp;
|
|
57148
57103
|
let propSet;
|
|
57149
57104
|
let indexTypes;
|
|
@@ -57211,7 +57166,7 @@ function createTypeChecker(host) {
|
|
|
57211
57166
|
}
|
|
57212
57167
|
if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {
|
|
57213
57168
|
if (mergedInstantiations) {
|
|
57214
|
-
const links = (
|
|
57169
|
+
const links = (_a = tryCast(singleProp, isTransientSymbol)) == null ? void 0 : _a.links;
|
|
57215
57170
|
const clone = createSymbolWithType(singleProp, links == null ? void 0 : links.type);
|
|
57216
57171
|
clone.parent = (_c = (_b = singleProp.valueDeclaration) == null ? void 0 : _b.symbol) == null ? void 0 : _c.parent;
|
|
57217
57172
|
clone.links.containingType = containingType;
|
|
@@ -57282,8 +57237,8 @@ function createTypeChecker(host) {
|
|
|
57282
57237
|
return result;
|
|
57283
57238
|
}
|
|
57284
57239
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
57285
|
-
var
|
|
57286
|
-
let property = skipObjectFunctionPropertyAugment ? (
|
|
57240
|
+
var _a, _b, _c;
|
|
57241
|
+
let property = skipObjectFunctionPropertyAugment ? (_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name) : (_b = type.propertyCache) == null ? void 0 : _b.get(name);
|
|
57287
57242
|
if (!property) {
|
|
57288
57243
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
57289
57244
|
if (property) {
|
|
@@ -57384,12 +57339,12 @@ function createTypeChecker(host) {
|
|
|
57384
57339
|
return errorInfo;
|
|
57385
57340
|
}
|
|
57386
57341
|
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
|
|
57387
|
-
var
|
|
57342
|
+
var _a, _b;
|
|
57388
57343
|
type = getReducedApparentType(type);
|
|
57389
57344
|
if (type.flags & 524288 /* Object */) {
|
|
57390
57345
|
const resolved = resolveStructuredTypeMembers(type);
|
|
57391
57346
|
const symbol = resolved.members.get(name);
|
|
57392
|
-
if (symbol && !includeTypeOnlyMembers && ((
|
|
57347
|
+
if (symbol && !includeTypeOnlyMembers && ((_a = type.symbol) == null ? void 0 : _a.flags) & 512 /* ValueModule */ && ((_b = getSymbolLinks(type.symbol).typeOnlyExportStarMap) == null ? void 0 : _b.has(name))) {
|
|
57393
57348
|
return void 0;
|
|
57394
57349
|
}
|
|
57395
57350
|
if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) {
|
|
@@ -57441,8 +57396,8 @@ function createTypeChecker(host) {
|
|
|
57441
57396
|
}
|
|
57442
57397
|
let memberName;
|
|
57443
57398
|
if (everyType(type, (t) => {
|
|
57444
|
-
var
|
|
57445
|
-
return !!((
|
|
57399
|
+
var _a;
|
|
57400
|
+
return !!((_a = t.symbol) == null ? void 0 : _a.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
|
|
57446
57401
|
})) {
|
|
57447
57402
|
const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
|
|
57448
57403
|
const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
|
|
@@ -57506,8 +57461,8 @@ function createTypeChecker(host) {
|
|
|
57506
57461
|
return findIndexInfo(getIndexInfosOfType(type), keyType);
|
|
57507
57462
|
}
|
|
57508
57463
|
function getIndexTypeOfType(type, keyType) {
|
|
57509
|
-
var
|
|
57510
|
-
return (
|
|
57464
|
+
var _a;
|
|
57465
|
+
return (_a = getIndexInfoOfType(type, keyType)) == null ? void 0 : _a.type;
|
|
57511
57466
|
}
|
|
57512
57467
|
function getApplicableIndexInfos(type, keyType) {
|
|
57513
57468
|
return getIndexInfosOfType(type).filter((info) => isApplicableIndexType(keyType, info.keyType));
|
|
@@ -57519,12 +57474,12 @@ function createTypeChecker(host) {
|
|
|
57519
57474
|
return getApplicableIndexInfo(type, isLateBoundName(name) ? esSymbolType : getStringLiteralType(unescapeLeadingUnderscores(name)));
|
|
57520
57475
|
}
|
|
57521
57476
|
function getTypeParametersFromDeclaration(declaration) {
|
|
57522
|
-
var
|
|
57477
|
+
var _a;
|
|
57523
57478
|
let result;
|
|
57524
57479
|
for (const node of getEffectiveTypeParameterDeclarations(declaration)) {
|
|
57525
57480
|
result = appendIfUnique(result, getDeclaredTypeOfTypeParameter(node.symbol));
|
|
57526
57481
|
}
|
|
57527
|
-
return (result == null ? void 0 : result.length) ? result : isFunctionDeclaration(declaration) ? (
|
|
57482
|
+
return (result == null ? void 0 : result.length) ? result : isFunctionDeclaration(declaration) ? (_a = getSignatureOfTypeTag(declaration)) == null ? void 0 : _a.typeParameters : void 0;
|
|
57528
57483
|
}
|
|
57529
57484
|
function symbolsToArray(symbols) {
|
|
57530
57485
|
const result = [];
|
|
@@ -58011,9 +57966,9 @@ function createTypeChecker(host) {
|
|
|
58011
57966
|
return signature;
|
|
58012
57967
|
}
|
|
58013
57968
|
function getOrCreateTypeFromSignature(signature, outerTypeParameters) {
|
|
58014
|
-
var
|
|
57969
|
+
var _a;
|
|
58015
57970
|
if (!signature.isolatedSignatureType) {
|
|
58016
|
-
const kind = (
|
|
57971
|
+
const kind = (_a = signature.declaration) == null ? void 0 : _a.kind;
|
|
58017
57972
|
const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
|
|
58018
57973
|
const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */));
|
|
58019
57974
|
if (signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
@@ -58074,9 +58029,9 @@ function createTypeChecker(host) {
|
|
|
58074
58029
|
return mapDefined(filter(type.symbol && type.symbol.declarations, isTypeParameterDeclaration), getEffectiveConstraintOfTypeParameter)[0];
|
|
58075
58030
|
}
|
|
58076
58031
|
function getInferredTypeParameterConstraint(typeParameter, omitTypeReferences) {
|
|
58077
|
-
var
|
|
58032
|
+
var _a;
|
|
58078
58033
|
let inferences;
|
|
58079
|
-
if ((
|
|
58034
|
+
if ((_a = typeParameter.symbol) == null ? void 0 : _a.declarations) {
|
|
58080
58035
|
for (const declaration of typeParameter.symbol.declarations) {
|
|
58081
58036
|
if (declaration.parent.kind === 195 /* InferType */) {
|
|
58082
58037
|
const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent);
|
|
@@ -58217,10 +58172,10 @@ function createTypeChecker(host) {
|
|
|
58217
58172
|
return type;
|
|
58218
58173
|
}
|
|
58219
58174
|
function getTypeArguments(type) {
|
|
58220
|
-
var
|
|
58175
|
+
var _a, _b;
|
|
58221
58176
|
if (!type.resolvedTypeArguments) {
|
|
58222
58177
|
if (!pushTypeResolution(type, 6 /* ResolvedTypeArguments */)) {
|
|
58223
|
-
return ((
|
|
58178
|
+
return ((_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
|
|
58224
58179
|
}
|
|
58225
58180
|
const node = type.node;
|
|
58226
58181
|
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
|
|
@@ -58351,8 +58306,8 @@ function createTypeChecker(host) {
|
|
|
58351
58306
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
58352
58307
|
}
|
|
58353
58308
|
function isLocalTypeAlias(symbol) {
|
|
58354
|
-
var
|
|
58355
|
-
const declaration = (
|
|
58309
|
+
var _a;
|
|
58310
|
+
const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias);
|
|
58356
58311
|
return !!(declaration && getContainingFunction(declaration));
|
|
58357
58312
|
}
|
|
58358
58313
|
function getTypeReferenceName(node) {
|
|
@@ -59189,7 +59144,7 @@ function createTypeChecker(host) {
|
|
|
59189
59144
|
return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
|
|
59190
59145
|
}
|
|
59191
59146
|
function createNormalizedTupleType(target, elementTypes) {
|
|
59192
|
-
var
|
|
59147
|
+
var _a, _b, _c, _d;
|
|
59193
59148
|
if (!(target.combinedFlags & 14 /* NonRequired */)) {
|
|
59194
59149
|
return createTypeReference(target, elementTypes);
|
|
59195
59150
|
}
|
|
@@ -59210,7 +59165,7 @@ function createTypeChecker(host) {
|
|
|
59210
59165
|
const flags = target.elementFlags[i];
|
|
59211
59166
|
if (flags & 8 /* Variadic */) {
|
|
59212
59167
|
if (type.flags & 1 /* Any */) {
|
|
59213
|
-
addElement(type, 4 /* Rest */, (
|
|
59168
|
+
addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
|
|
59214
59169
|
} else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
|
|
59215
59170
|
addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
|
|
59216
59171
|
} else if (isTupleType(type)) {
|
|
@@ -59223,8 +59178,8 @@ function createTypeChecker(host) {
|
|
|
59223
59178
|
return errorType;
|
|
59224
59179
|
}
|
|
59225
59180
|
forEach(elements, (t, n) => {
|
|
59226
|
-
var
|
|
59227
|
-
return addElement(t, type.target.elementFlags[n], (
|
|
59181
|
+
var _a2;
|
|
59182
|
+
return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
|
|
59228
59183
|
});
|
|
59229
59184
|
} else {
|
|
59230
59185
|
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
|
|
@@ -59348,7 +59303,7 @@ function createTypeChecker(host) {
|
|
|
59348
59303
|
return includes;
|
|
59349
59304
|
}
|
|
59350
59305
|
function removeSubtypes(types, hasObjectTypes) {
|
|
59351
|
-
var
|
|
59306
|
+
var _a;
|
|
59352
59307
|
if (types.length < 2) {
|
|
59353
59308
|
return types;
|
|
59354
59309
|
}
|
|
@@ -59378,7 +59333,7 @@ function createTypeChecker(host) {
|
|
|
59378
59333
|
if (count === 1e5) {
|
|
59379
59334
|
const estimatedCount = count / (len - i) * len;
|
|
59380
59335
|
if (estimatedCount > 1e6) {
|
|
59381
|
-
(
|
|
59336
|
+
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "removeSubtypes_DepthLimit", { typeIds: types.map((t) => t.id) });
|
|
59382
59337
|
error(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
|
|
59383
59338
|
return void 0;
|
|
59384
59339
|
}
|
|
@@ -59756,7 +59711,7 @@ function createTypeChecker(host) {
|
|
|
59756
59711
|
result.aliasTypeArguments = aliasTypeArguments;
|
|
59757
59712
|
return result;
|
|
59758
59713
|
}
|
|
59759
|
-
function getIntersectionType(types, aliasSymbol, aliasTypeArguments
|
|
59714
|
+
function getIntersectionType(types, flags = 0 /* None */, aliasSymbol, aliasTypeArguments) {
|
|
59760
59715
|
const typeMembershipMap = /* @__PURE__ */ new Map();
|
|
59761
59716
|
const includes = addTypesToIntersection(typeMembershipMap, 0, types);
|
|
59762
59717
|
const typeSet = arrayFrom(typeMembershipMap.values());
|
|
@@ -59777,7 +59732,7 @@ function createTypeChecker(host) {
|
|
|
59777
59732
|
return includes & 16777216 /* IncludesEmptyObject */ ? neverType : includes & 32768 /* Undefined */ ? undefinedType : nullType;
|
|
59778
59733
|
}
|
|
59779
59734
|
if (includes & 4 /* String */ && includes & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 8 /* Number */ && includes & 256 /* NumberLiteral */ || includes & 64 /* BigInt */ && includes & 2048 /* BigIntLiteral */ || includes & 4096 /* ESSymbol */ && includes & 8192 /* UniqueESSymbol */ || includes & 16384 /* Void */ && includes & 32768 /* Undefined */ || includes & 16777216 /* IncludesEmptyObject */ && includes & 470302716 /* DefinitelyNonNullable */) {
|
|
59780
|
-
if (!
|
|
59735
|
+
if (!(flags & 1 /* NoSupertypeReduction */))
|
|
59781
59736
|
removeRedundantSupertypes(typeSet, includes);
|
|
59782
59737
|
}
|
|
59783
59738
|
if (includes & 262144 /* IncludesMissingType */) {
|
|
@@ -59789,7 +59744,7 @@ function createTypeChecker(host) {
|
|
|
59789
59744
|
if (typeSet.length === 1) {
|
|
59790
59745
|
return typeSet[0];
|
|
59791
59746
|
}
|
|
59792
|
-
if (typeSet.length === 2) {
|
|
59747
|
+
if (typeSet.length === 2 && !(flags & 2 /* NoConstraintReduction */)) {
|
|
59793
59748
|
const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
59794
59749
|
const typeVariable = typeSet[typeVarIndex];
|
|
59795
59750
|
const primitiveType = typeSet[1 - typeVarIndex];
|
|
@@ -59808,27 +59763,27 @@ function createTypeChecker(host) {
|
|
|
59808
59763
|
}
|
|
59809
59764
|
}
|
|
59810
59765
|
}
|
|
59811
|
-
const id = getTypeListId(typeSet) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
59766
|
+
const id = getTypeListId(typeSet) + (flags & 2 /* NoConstraintReduction */ ? "*" : getAliasId(aliasSymbol, aliasTypeArguments));
|
|
59812
59767
|
let result = intersectionTypes.get(id);
|
|
59813
59768
|
if (!result) {
|
|
59814
59769
|
if (includes & 1048576 /* Union */) {
|
|
59815
59770
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
59816
|
-
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
59771
|
+
result = getIntersectionType(typeSet, flags, aliasSymbol, aliasTypeArguments);
|
|
59817
59772
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
|
|
59818
59773
|
const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
|
|
59819
59774
|
removeFromEach(typeSet, 32768 /* Undefined */);
|
|
59820
|
-
result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
59775
|
+
result = getUnionType([getIntersectionType(typeSet, flags), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
59821
59776
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
59822
59777
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
59823
|
-
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
59778
|
+
result = getUnionType([getIntersectionType(typeSet, flags), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
59824
59779
|
} else if (typeSet.length >= 4) {
|
|
59825
59780
|
const middle = Math.floor(typeSet.length / 2);
|
|
59826
|
-
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
|
|
59781
|
+
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle), flags), getIntersectionType(typeSet.slice(middle), flags)], flags, aliasSymbol, aliasTypeArguments);
|
|
59827
59782
|
} else {
|
|
59828
59783
|
if (!checkCrossProductUnion(typeSet)) {
|
|
59829
59784
|
return errorType;
|
|
59830
59785
|
}
|
|
59831
|
-
const constituents = getCrossProductIntersections(typeSet);
|
|
59786
|
+
const constituents = getCrossProductIntersections(typeSet, flags);
|
|
59832
59787
|
const origin = some(constituents, (t) => !!(t.flags & 2097152 /* Intersection */)) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152 /* Intersection */, typeSet) : void 0;
|
|
59833
59788
|
result = getUnionType(constituents, 1 /* Literal */, aliasSymbol, aliasTypeArguments, origin);
|
|
59834
59789
|
}
|
|
@@ -59843,16 +59798,16 @@ function createTypeChecker(host) {
|
|
|
59843
59798
|
return reduceLeft(types, (n, t) => t.flags & 1048576 /* Union */ ? n * t.types.length : t.flags & 131072 /* Never */ ? 0 : n, 1);
|
|
59844
59799
|
}
|
|
59845
59800
|
function checkCrossProductUnion(types) {
|
|
59846
|
-
var
|
|
59801
|
+
var _a;
|
|
59847
59802
|
const size = getCrossProductUnionSize(types);
|
|
59848
59803
|
if (size >= 1e5) {
|
|
59849
|
-
(
|
|
59804
|
+
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkCrossProductUnion_DepthLimit", { typeIds: types.map((t) => t.id), size });
|
|
59850
59805
|
error(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
|
|
59851
59806
|
return false;
|
|
59852
59807
|
}
|
|
59853
59808
|
return true;
|
|
59854
59809
|
}
|
|
59855
|
-
function getCrossProductIntersections(types) {
|
|
59810
|
+
function getCrossProductIntersections(types, flags) {
|
|
59856
59811
|
const count = getCrossProductUnionSize(types);
|
|
59857
59812
|
const intersections = [];
|
|
59858
59813
|
for (let i = 0; i < count; i++) {
|
|
@@ -59866,7 +59821,7 @@ function createTypeChecker(host) {
|
|
|
59866
59821
|
n = Math.floor(n / length2);
|
|
59867
59822
|
}
|
|
59868
59823
|
}
|
|
59869
|
-
const t = getIntersectionType(constituents);
|
|
59824
|
+
const t = getIntersectionType(constituents, flags);
|
|
59870
59825
|
if (!(t.flags & 131072 /* Never */))
|
|
59871
59826
|
intersections.push(t);
|
|
59872
59827
|
}
|
|
@@ -59886,7 +59841,7 @@ function createTypeChecker(host) {
|
|
|
59886
59841
|
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
59887
59842
|
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
59888
59843
|
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
59889
|
-
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)
|
|
59844
|
+
links.resolvedType = getIntersectionType(types, noSupertypeReduction ? 1 /* NoSupertypeReduction */ : 0, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
|
|
59890
59845
|
}
|
|
59891
59846
|
return links.resolvedType;
|
|
59892
59847
|
}
|
|
@@ -60034,7 +59989,7 @@ function createTypeChecker(host) {
|
|
|
60034
59989
|
return links.resolvedType;
|
|
60035
59990
|
}
|
|
60036
59991
|
function getTemplateLiteralType(texts, types) {
|
|
60037
|
-
var
|
|
59992
|
+
var _a, _b;
|
|
60038
59993
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
60039
59994
|
if (unionIndex >= 0) {
|
|
60040
59995
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -60042,7 +59997,7 @@ function createTypeChecker(host) {
|
|
|
60042
59997
|
if (contains(types, wildcardType)) {
|
|
60043
59998
|
return wildcardType;
|
|
60044
59999
|
}
|
|
60045
|
-
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (
|
|
60000
|
+
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a = types[0].symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
60046
60001
|
return types[0];
|
|
60047
60002
|
}
|
|
60048
60003
|
const newTypes = [];
|
|
@@ -60546,7 +60501,7 @@ function createTypeChecker(host) {
|
|
|
60546
60501
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
60547
60502
|
indexType = stringType;
|
|
60548
60503
|
}
|
|
60549
|
-
if (noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
60504
|
+
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
60550
60505
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
60551
60506
|
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) {
|
|
60552
60507
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
@@ -60577,7 +60532,7 @@ function createTypeChecker(host) {
|
|
|
60577
60532
|
if (wasMissingProp) {
|
|
60578
60533
|
return void 0;
|
|
60579
60534
|
}
|
|
60580
|
-
return accessFlags & 4 /* Writing */ ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
60535
|
+
return accessFlags & 4 /* Writing */ ? getIntersectionType(propTypes, 0 /* None */, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
60581
60536
|
}
|
|
60582
60537
|
return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, accessNode, accessFlags | 8 /* CacheSymbol */ | 64 /* ReportDeprecated */);
|
|
60583
60538
|
}
|
|
@@ -60794,7 +60749,7 @@ function createTypeChecker(host) {
|
|
|
60794
60749
|
}
|
|
60795
60750
|
}
|
|
60796
60751
|
function getTypeFromImportTypeNode(node) {
|
|
60797
|
-
var
|
|
60752
|
+
var _a;
|
|
60798
60753
|
const links = getNodeLinks(node);
|
|
60799
60754
|
if (!links.resolvedType) {
|
|
60800
60755
|
if (!isLiteralImportTypeNode(node)) {
|
|
@@ -60808,7 +60763,7 @@ function createTypeChecker(host) {
|
|
|
60808
60763
|
links.resolvedSymbol = unknownSymbol;
|
|
60809
60764
|
return links.resolvedType = errorType;
|
|
60810
60765
|
}
|
|
60811
|
-
const isExportEquals = !!((
|
|
60766
|
+
const isExportEquals = !!((_a = innerModuleSymbol.exports) == null ? void 0 : _a.get("export=" /* ExportEquals */));
|
|
60812
60767
|
const moduleSymbol = resolveExternalModuleSymbol(
|
|
60813
60768
|
innerModuleSymbol,
|
|
60814
60769
|
/*dontResolveAlias*/
|
|
@@ -61013,8 +60968,8 @@ function createTypeChecker(host) {
|
|
|
61013
60968
|
return spread;
|
|
61014
60969
|
}
|
|
61015
60970
|
function isSpreadableProperty(prop) {
|
|
61016
|
-
var
|
|
61017
|
-
return !some(prop.declarations, isPrivateIdentifierClassElementDeclaration) && (!(prop.flags & (8192 /* Method */ | 32768 /* GetAccessor */ | 65536 /* SetAccessor */)) || !((
|
|
60971
|
+
var _a;
|
|
60972
|
+
return !some(prop.declarations, isPrivateIdentifierClassElementDeclaration) && (!(prop.flags & (8192 /* Method */ | 32768 /* GetAccessor */ | 65536 /* SetAccessor */)) || !((_a = prop.declarations) == null ? void 0 : _a.some((decl) => isClassLike(decl.parent))));
|
|
61018
60973
|
}
|
|
61019
60974
|
function getSpreadSymbol(prop, readonly) {
|
|
61020
60975
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
@@ -61656,12 +61611,12 @@ function createTypeChecker(host) {
|
|
|
61656
61611
|
) : type;
|
|
61657
61612
|
}
|
|
61658
61613
|
function instantiateTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
61659
|
-
var
|
|
61614
|
+
var _a;
|
|
61660
61615
|
if (!couldContainTypeVariables(type)) {
|
|
61661
61616
|
return type;
|
|
61662
61617
|
}
|
|
61663
61618
|
if (instantiationDepth === 100 || instantiationCount >= 5e6) {
|
|
61664
|
-
(
|
|
61619
|
+
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth, instantiationCount });
|
|
61665
61620
|
error(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
61666
61621
|
return errorType;
|
|
61667
61622
|
}
|
|
@@ -61701,7 +61656,7 @@ function createTypeChecker(host) {
|
|
|
61701
61656
|
}
|
|
61702
61657
|
const newAliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
61703
61658
|
const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
61704
|
-
return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ? getIntersectionType(newTypes, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments);
|
|
61659
|
+
return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ? getIntersectionType(newTypes, 0 /* None */, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments);
|
|
61705
61660
|
}
|
|
61706
61661
|
if (flags & 4194304 /* Index */) {
|
|
61707
61662
|
return getIndexType(instantiateType(type.type, mapper));
|
|
@@ -62835,7 +62790,7 @@ function createTypeChecker(host) {
|
|
|
62835
62790
|
return elements !== normalizedElements ? createNormalizedTupleType(type.target, normalizedElements) : type;
|
|
62836
62791
|
}
|
|
62837
62792
|
function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) {
|
|
62838
|
-
var
|
|
62793
|
+
var _a;
|
|
62839
62794
|
let errorInfo;
|
|
62840
62795
|
let relatedInfo;
|
|
62841
62796
|
let maybeKeys;
|
|
@@ -62875,7 +62830,7 @@ function createTypeChecker(host) {
|
|
|
62875
62830
|
false
|
|
62876
62831
|
);
|
|
62877
62832
|
relation.set(id, 4 /* Reported */ | 2 /* Failed */);
|
|
62878
|
-
(
|
|
62833
|
+
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
|
|
62879
62834
|
const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1;
|
|
62880
62835
|
const diag2 = error(errorNode || currentNode, message, typeToString(source), typeToString(target));
|
|
62881
62836
|
if (errorOutputContainer) {
|
|
@@ -63250,7 +63205,7 @@ function createTypeChecker(host) {
|
|
|
63250
63205
|
return 0 /* False */;
|
|
63251
63206
|
}
|
|
63252
63207
|
function reportErrorResults(originalSource, originalTarget, source2, target2, headMessage2) {
|
|
63253
|
-
var
|
|
63208
|
+
var _a2, _b;
|
|
63254
63209
|
const sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
63255
63210
|
const targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
63256
63211
|
source2 = originalSource.aliasSymbol || sourceHasBase ? originalSource : source2;
|
|
@@ -63300,7 +63255,7 @@ function createTypeChecker(host) {
|
|
|
63300
63255
|
return;
|
|
63301
63256
|
}
|
|
63302
63257
|
reportRelationError(headMessage2, source2, target2);
|
|
63303
|
-
if (source2.flags & 262144 /* TypeParameter */ && ((_b = (
|
|
63258
|
+
if (source2.flags & 262144 /* TypeParameter */ && ((_b = (_a2 = source2.symbol) == null ? void 0 : _a2.declarations) == null ? void 0 : _b[0]) && !getConstraintOfType(source2)) {
|
|
63304
63259
|
const syntheticParam = cloneTypeParameter(source2);
|
|
63305
63260
|
syntheticParam.constraint = instantiateType(target2, makeUnaryTypeMapper(source2, syntheticParam));
|
|
63306
63261
|
if (hasNonCircularBaseConstraint(syntheticParam)) {
|
|
@@ -63335,10 +63290,10 @@ function createTypeChecker(host) {
|
|
|
63335
63290
|
}
|
|
63336
63291
|
function getTypeOfPropertyInTypes(types, name) {
|
|
63337
63292
|
const appendPropType = (propTypes, type) => {
|
|
63338
|
-
var
|
|
63293
|
+
var _a2;
|
|
63339
63294
|
type = getApparentType(type);
|
|
63340
63295
|
const prop = type.flags & 3145728 /* UnionOrIntersection */ ? getPropertyOfUnionOrIntersectionType(type, name) : getPropertyOfObjectType(type, name);
|
|
63341
|
-
const propType = prop && getTypeOfSymbol(prop) || ((
|
|
63296
|
+
const propType = prop && getTypeOfSymbol(prop) || ((_a2 = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a2.type) || undefinedType;
|
|
63342
63297
|
return append(propTypes, propType);
|
|
63343
63298
|
};
|
|
63344
63299
|
return getUnionType(reduceLeft(
|
|
@@ -63349,7 +63304,7 @@ function createTypeChecker(host) {
|
|
|
63349
63304
|
) || emptyArray);
|
|
63350
63305
|
}
|
|
63351
63306
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
63352
|
-
var
|
|
63307
|
+
var _a2;
|
|
63353
63308
|
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 4096 /* JSLiteral */) {
|
|
63354
63309
|
return false;
|
|
63355
63310
|
}
|
|
@@ -63383,7 +63338,7 @@ function createTypeChecker(host) {
|
|
|
63383
63338
|
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
|
|
63384
63339
|
}
|
|
63385
63340
|
} else {
|
|
63386
|
-
const objectLiteralDeclaration = ((
|
|
63341
|
+
const objectLiteralDeclaration = ((_a2 = source2.symbol) == null ? void 0 : _a2.declarations) && firstOrUndefined(source2.symbol.declarations);
|
|
63387
63342
|
let suggestion;
|
|
63388
63343
|
if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, (d) => d === objectLiteralDeclaration) && getSourceFileOfNode(objectLiteralDeclaration) === getSourceFileOfNode(errorNode)) {
|
|
63389
63344
|
const propDeclaration = prop.valueDeclaration;
|
|
@@ -63723,7 +63678,7 @@ function createTypeChecker(host) {
|
|
|
63723
63678
|
return result2;
|
|
63724
63679
|
}
|
|
63725
63680
|
function recursiveTypeRelatedTo(source2, target2, reportErrors2, intersectionState, recursionFlags) {
|
|
63726
|
-
var
|
|
63681
|
+
var _a2, _b, _c;
|
|
63727
63682
|
if (overflow) {
|
|
63728
63683
|
return 0 /* False */;
|
|
63729
63684
|
}
|
|
@@ -63808,7 +63763,7 @@ function createTypeChecker(host) {
|
|
|
63808
63763
|
}
|
|
63809
63764
|
let result2;
|
|
63810
63765
|
if (expandingFlags === 3 /* Both */) {
|
|
63811
|
-
(
|
|
63766
|
+
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "recursiveTypeRelatedTo_DepthLimit", {
|
|
63812
63767
|
sourceId: source2.id,
|
|
63813
63768
|
sourceIdStack: sourceStack.map((t) => t.id),
|
|
63814
63769
|
targetId: target2.id,
|
|
@@ -64489,7 +64444,7 @@ function createTypeChecker(host) {
|
|
|
64489
64444
|
return 0 /* False */;
|
|
64490
64445
|
}
|
|
64491
64446
|
function typeRelatedToDiscriminatedType(source2, target2) {
|
|
64492
|
-
var
|
|
64447
|
+
var _a2;
|
|
64493
64448
|
const sourceProperties = getPropertiesOfType(source2);
|
|
64494
64449
|
const sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target2);
|
|
64495
64450
|
if (!sourcePropertiesFiltered)
|
|
@@ -64498,7 +64453,7 @@ function createTypeChecker(host) {
|
|
|
64498
64453
|
for (const sourceProperty of sourcePropertiesFiltered) {
|
|
64499
64454
|
numCombinations *= countTypes(getNonMissingTypeOfSymbol(sourceProperty));
|
|
64500
64455
|
if (numCombinations > 25) {
|
|
64501
|
-
(
|
|
64456
|
+
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source2.id, targetId: target2.id, numCombinations });
|
|
64502
64457
|
return 0 /* False */;
|
|
64503
64458
|
}
|
|
64504
64459
|
}
|
|
@@ -64905,7 +64860,7 @@ function createTypeChecker(host) {
|
|
|
64905
64860
|
return result2;
|
|
64906
64861
|
}
|
|
64907
64862
|
function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) {
|
|
64908
|
-
var
|
|
64863
|
+
var _a2, _b;
|
|
64909
64864
|
if (relation === identityRelation) {
|
|
64910
64865
|
return signaturesIdenticalTo(source2, target2, kind);
|
|
64911
64866
|
}
|
|
@@ -64961,7 +64916,7 @@ function createTypeChecker(host) {
|
|
|
64961
64916
|
const sourceSignature = first(sourceSignatures);
|
|
64962
64917
|
const targetSignature = first(targetSignatures);
|
|
64963
64918
|
result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature));
|
|
64964
|
-
if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((
|
|
64919
|
+
if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a2 = targetSignature.declaration) == null ? void 0 : _a2.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) {
|
|
64965
64920
|
const constructSignatureToString = (signature) => signatureToString(
|
|
64966
64921
|
signature,
|
|
64967
64922
|
/*enclosingDeclaration*/
|
|
@@ -65279,10 +65234,10 @@ function createTypeChecker(host) {
|
|
|
65279
65234
|
return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters);
|
|
65280
65235
|
}
|
|
65281
65236
|
function getVariancesWorker(symbol, typeParameters = emptyArray) {
|
|
65282
|
-
var
|
|
65237
|
+
var _a, _b;
|
|
65283
65238
|
const links = getSymbolLinks(symbol);
|
|
65284
65239
|
if (!links.variances) {
|
|
65285
|
-
(
|
|
65240
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
65286
65241
|
const oldVarianceComputation = inVarianceComputation;
|
|
65287
65242
|
const saveResolutionStart = resolutionStart;
|
|
65288
65243
|
if (!inVarianceComputation) {
|
|
@@ -65340,8 +65295,8 @@ function createTypeChecker(host) {
|
|
|
65340
65295
|
return markerTypes.has(getTypeId(type));
|
|
65341
65296
|
}
|
|
65342
65297
|
function getTypeParameterModifiers(tp) {
|
|
65343
|
-
var
|
|
65344
|
-
return reduceLeft((
|
|
65298
|
+
var _a;
|
|
65299
|
+
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (8192 /* In */ | 16384 /* Out */ | 4096 /* Const */);
|
|
65345
65300
|
}
|
|
65346
65301
|
function hasCovariantVoidArgument(typeArguments, variances) {
|
|
65347
65302
|
for (let i = 0; i < variances.length; i++) {
|
|
@@ -65399,7 +65354,7 @@ function createTypeChecker(host) {
|
|
|
65399
65354
|
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : `${source.id},${target.id}${postFix}`;
|
|
65400
65355
|
}
|
|
65401
65356
|
function forEachProperty(prop, callback) {
|
|
65402
|
-
if (getCheckFlags(prop) & 6 /*
|
|
65357
|
+
if (getCheckFlags(prop) & 6 /* Synthetic */) {
|
|
65403
65358
|
for (const t of prop.links.containingType.types) {
|
|
65404
65359
|
const p = getPropertyOfType(t, prop.escapedName);
|
|
65405
65360
|
const result = p && forEachProperty(p, callback);
|
|
@@ -65697,7 +65652,7 @@ function createTypeChecker(host) {
|
|
|
65697
65652
|
return propType;
|
|
65698
65653
|
}
|
|
65699
65654
|
if (everyType(type, isTupleType)) {
|
|
65700
|
-
return getTupleElementTypeOutOfStartCount(type, index, noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
65655
|
+
return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
65701
65656
|
}
|
|
65702
65657
|
return void 0;
|
|
65703
65658
|
}
|
|
@@ -67016,7 +66971,7 @@ function createTypeChecker(host) {
|
|
|
67016
66971
|
inferFromTypes(sourceNameType, targetNameType);
|
|
67017
66972
|
}
|
|
67018
66973
|
function inferFromObjectTypes(source, target) {
|
|
67019
|
-
var
|
|
66974
|
+
var _a, _b;
|
|
67020
66975
|
if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
|
|
67021
66976
|
inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target));
|
|
67022
66977
|
return;
|
|
@@ -67063,7 +67018,7 @@ function createTypeChecker(host) {
|
|
|
67063
67018
|
inferFromTypes(sliceTupleType(source, startLength + targetInfo.impliedArity, endLength), elementTypes[startLength + 1]);
|
|
67064
67019
|
}
|
|
67065
67020
|
} else if (elementFlags[startLength] & 8 /* Variadic */ && elementFlags[startLength + 1] & 4 /* Rest */) {
|
|
67066
|
-
const param = (
|
|
67021
|
+
const param = (_a = getInferenceInfoForType(elementTypes[startLength])) == null ? void 0 : _a.typeParameter;
|
|
67067
67022
|
const constraint = param && getBaseConstraintOfType(param);
|
|
67068
67023
|
if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) {
|
|
67069
67024
|
const impliedArity = constraint.target.fixedLength;
|
|
@@ -67550,8 +67505,8 @@ function createTypeChecker(host) {
|
|
|
67550
67505
|
return unionType.keyPropertyName.length ? unionType.keyPropertyName : void 0;
|
|
67551
67506
|
}
|
|
67552
67507
|
function getConstituentTypeForKeyType(unionType, keyType) {
|
|
67553
|
-
var
|
|
67554
|
-
const result = (
|
|
67508
|
+
var _a;
|
|
67509
|
+
const result = (_a = unionType.constituentMap) == null ? void 0 : _a.get(getTypeId(getRegularTypeOfLiteralType(keyType)));
|
|
67555
67510
|
return result !== unknownType ? result : void 0;
|
|
67556
67511
|
}
|
|
67557
67512
|
function getMatchingUnionConstituentForType(unionType, type) {
|
|
@@ -67735,12 +67690,12 @@ function createTypeChecker(host) {
|
|
|
67735
67690
|
return defaultExpression ? getUnionType([getNonUndefinedType(type), getTypeOfExpression(defaultExpression)]) : type;
|
|
67736
67691
|
}
|
|
67737
67692
|
function getTypeOfDestructuredProperty(type, name) {
|
|
67738
|
-
var
|
|
67693
|
+
var _a;
|
|
67739
67694
|
const nameType = getLiteralTypeFromPropertyName(name);
|
|
67740
67695
|
if (!isTypeUsableAsPropertyName(nameType))
|
|
67741
67696
|
return errorType;
|
|
67742
67697
|
const text = getPropertyNameFromType(nameType);
|
|
67743
|
-
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((
|
|
67698
|
+
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a = getApplicableIndexInfoForName(type, text)) == null ? void 0 : _a.type) || errorType;
|
|
67744
67699
|
}
|
|
67745
67700
|
function getTypeOfDestructuredArrayElement(type, index) {
|
|
67746
67701
|
return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(
|
|
@@ -67754,7 +67709,7 @@ function createTypeChecker(host) {
|
|
|
67754
67709
|
function includeUndefinedInIndexSignature(type) {
|
|
67755
67710
|
if (!type)
|
|
67756
67711
|
return type;
|
|
67757
|
-
return noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type;
|
|
67712
|
+
return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type;
|
|
67758
67713
|
}
|
|
67759
67714
|
function getTypeOfDestructuredSpreadExpression(type) {
|
|
67760
67715
|
return createArrayType(checkIteratedTypeOrElementType(
|
|
@@ -68317,7 +68272,7 @@ function createTypeChecker(host) {
|
|
|
68317
68272
|
}
|
|
68318
68273
|
return false;
|
|
68319
68274
|
}
|
|
68320
|
-
function getFlowTypeOfReference(reference, declaredType, initialType = declaredType, flowContainer, flowNode = ((
|
|
68275
|
+
function getFlowTypeOfReference(reference, declaredType, initialType = declaredType, flowContainer, flowNode = ((_a) => (_a = tryCast(reference, canHaveFlowNode)) == null ? void 0 : _a.flowNode)()) {
|
|
68321
68276
|
let key;
|
|
68322
68277
|
let isKeySet = false;
|
|
68323
68278
|
let flowDepth = 0;
|
|
@@ -69579,7 +69534,7 @@ function createTypeChecker(host) {
|
|
|
69579
69534
|
}
|
|
69580
69535
|
}
|
|
69581
69536
|
function getNarrowedTypeOfSymbol(symbol, location, checkMode) {
|
|
69582
|
-
var
|
|
69537
|
+
var _a;
|
|
69583
69538
|
const type = getTypeOfSymbol(symbol, checkMode);
|
|
69584
69539
|
const declaration = symbol.valueDeclaration;
|
|
69585
69540
|
if (declaration) {
|
|
@@ -69621,7 +69576,7 @@ function createTypeChecker(host) {
|
|
|
69621
69576
|
if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
|
|
69622
69577
|
const contextualSignature = getContextualSignature(func);
|
|
69623
69578
|
if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
|
|
69624
|
-
const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (
|
|
69579
|
+
const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
|
|
69625
69580
|
if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !some(func.parameters, isSomeSymbolAssigned)) {
|
|
69626
69581
|
const narrowedType = getFlowTypeOfReference(
|
|
69627
69582
|
func,
|
|
@@ -69773,7 +69728,7 @@ function createTypeChecker(host) {
|
|
|
69773
69728
|
}
|
|
69774
69729
|
}
|
|
69775
69730
|
function shouldMarkIdentifierAliasReferenced(node) {
|
|
69776
|
-
var
|
|
69731
|
+
var _a;
|
|
69777
69732
|
const parent = node.parent;
|
|
69778
69733
|
if (parent) {
|
|
69779
69734
|
if (isPropertyAccessExpression(parent) && parent.expression === node) {
|
|
@@ -69782,7 +69737,7 @@ function createTypeChecker(host) {
|
|
|
69782
69737
|
if (isExportSpecifier(parent) && parent.isTypeOnly) {
|
|
69783
69738
|
return false;
|
|
69784
69739
|
}
|
|
69785
|
-
const greatGrandparent = (
|
|
69740
|
+
const greatGrandparent = (_a = parent.parent) == null ? void 0 : _a.parent;
|
|
69786
69741
|
if (greatGrandparent && isExportDeclaration(greatGrandparent) && greatGrandparent.isTypeOnly) {
|
|
69787
69742
|
return false;
|
|
69788
69743
|
}
|
|
@@ -70514,7 +70469,7 @@ function createTypeChecker(host) {
|
|
|
70514
70469
|
}
|
|
70515
70470
|
}
|
|
70516
70471
|
function getContextualTypeForAssignmentDeclaration(binaryExpression) {
|
|
70517
|
-
var
|
|
70472
|
+
var _a, _b;
|
|
70518
70473
|
const kind = getAssignmentDeclarationKind(binaryExpression);
|
|
70519
70474
|
switch (kind) {
|
|
70520
70475
|
case 0 /* None */:
|
|
@@ -70573,7 +70528,7 @@ function createTypeChecker(host) {
|
|
|
70573
70528
|
case 2 /* ModuleExports */:
|
|
70574
70529
|
let valueDeclaration;
|
|
70575
70530
|
if (kind !== 2 /* ModuleExports */) {
|
|
70576
|
-
valueDeclaration = canHaveSymbol(binaryExpression.left) ? (
|
|
70531
|
+
valueDeclaration = canHaveSymbol(binaryExpression.left) ? (_a = binaryExpression.left.symbol) == null ? void 0 : _a.valueDeclaration : void 0;
|
|
70577
70532
|
}
|
|
70578
70533
|
valueDeclaration || (valueDeclaration = (_b = binaryExpression.symbol) == null ? void 0 : _b.valueDeclaration);
|
|
70579
70534
|
const annotated = valueDeclaration && getEffectiveTypeAnnotationNode(valueDeclaration);
|
|
@@ -70640,7 +70595,7 @@ function createTypeChecker(host) {
|
|
|
70640
70595
|
return mapType(
|
|
70641
70596
|
type,
|
|
70642
70597
|
(t) => {
|
|
70643
|
-
var
|
|
70598
|
+
var _a;
|
|
70644
70599
|
if (isGenericMappedType(t) && !t.declaration.nameType) {
|
|
70645
70600
|
const constraint = getConstraintTypeFromMappedType(t);
|
|
70646
70601
|
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
@@ -70668,7 +70623,7 @@ function createTypeChecker(host) {
|
|
|
70668
70623
|
return restType;
|
|
70669
70624
|
}
|
|
70670
70625
|
}
|
|
70671
|
-
return (
|
|
70626
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
70672
70627
|
}
|
|
70673
70628
|
return void 0;
|
|
70674
70629
|
},
|
|
@@ -70710,8 +70665,8 @@ function createTypeChecker(host) {
|
|
|
70710
70665
|
return mapType(
|
|
70711
70666
|
type,
|
|
70712
70667
|
(t) => {
|
|
70713
|
-
var
|
|
70714
|
-
return (
|
|
70668
|
+
var _a;
|
|
70669
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType)) == null ? void 0 : _a.type;
|
|
70715
70670
|
},
|
|
70716
70671
|
/*noReductions*/
|
|
70717
70672
|
true
|
|
@@ -70853,8 +70808,8 @@ function createTypeChecker(host) {
|
|
|
70853
70808
|
),
|
|
70854
70809
|
map(
|
|
70855
70810
|
filter(getPropertiesOfType(contextualType), (s) => {
|
|
70856
|
-
var
|
|
70857
|
-
return !!(s.flags & 16777216 /* Optional */) && !!((
|
|
70811
|
+
var _a;
|
|
70812
|
+
return !!(s.flags & 16777216 /* Optional */) && !!((_a = node == null ? void 0 : node.symbol) == null ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName);
|
|
70858
70813
|
}),
|
|
70859
70814
|
(s) => [() => undefinedType, s.escapedName]
|
|
70860
70815
|
)
|
|
@@ -70880,8 +70835,8 @@ function createTypeChecker(host) {
|
|
|
70880
70835
|
),
|
|
70881
70836
|
map(
|
|
70882
70837
|
filter(getPropertiesOfType(contextualType), (s) => {
|
|
70883
|
-
var
|
|
70884
|
-
if (!(s.flags & 16777216 /* Optional */) || !((
|
|
70838
|
+
var _a;
|
|
70839
|
+
if (!(s.flags & 16777216 /* Optional */) || !((_a = node == null ? void 0 : node.symbol) == null ? void 0 : _a.members)) {
|
|
70885
70840
|
return false;
|
|
70886
70841
|
}
|
|
70887
70842
|
const element = node.parent.parent;
|
|
@@ -70940,7 +70895,7 @@ function createTypeChecker(host) {
|
|
|
70940
70895
|
return type;
|
|
70941
70896
|
}
|
|
70942
70897
|
function getContextualType(node, contextFlags) {
|
|
70943
|
-
var
|
|
70898
|
+
var _a;
|
|
70944
70899
|
if (node.flags & 67108864 /* InWithStatement */) {
|
|
70945
70900
|
return void 0;
|
|
70946
70901
|
}
|
|
@@ -70986,7 +70941,7 @@ function createTypeChecker(host) {
|
|
|
70986
70941
|
const arrayLiteral = parent;
|
|
70987
70942
|
const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
|
|
70988
70943
|
const elementIndex = indexOfNode(arrayLiteral.elements, node);
|
|
70989
|
-
const spreadIndices = (
|
|
70944
|
+
const spreadIndices = (_a = getNodeLinks(arrayLiteral)).spreadIndices ?? (_a.spreadIndices = getSpreadIndices(arrayLiteral.elements));
|
|
70990
70945
|
return getContextualTypeForElementExpression(type, elementIndex, arrayLiteral.elements.length, spreadIndices.first, spreadIndices.last);
|
|
70991
70946
|
}
|
|
70992
70947
|
case 227 /* ConditionalExpression */:
|
|
@@ -71518,13 +71473,13 @@ function createTypeChecker(host) {
|
|
|
71518
71473
|
return links.resolvedType;
|
|
71519
71474
|
}
|
|
71520
71475
|
function isSymbolWithNumericName(symbol) {
|
|
71521
|
-
var
|
|
71522
|
-
const firstDecl = (
|
|
71476
|
+
var _a;
|
|
71477
|
+
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
71523
71478
|
return isNumericLiteralName(symbol.escapedName) || firstDecl && isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name);
|
|
71524
71479
|
}
|
|
71525
71480
|
function isSymbolWithSymbolName(symbol) {
|
|
71526
|
-
var
|
|
71527
|
-
const firstDecl = (
|
|
71481
|
+
var _a;
|
|
71482
|
+
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
71528
71483
|
return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
|
|
71529
71484
|
}
|
|
71530
71485
|
function getObjectLiteralIndexInfo(node, offset, properties, keyType) {
|
|
@@ -71554,7 +71509,7 @@ function createTypeChecker(host) {
|
|
|
71554
71509
|
return links.immediateTarget;
|
|
71555
71510
|
}
|
|
71556
71511
|
function checkObjectLiteral(node, checkMode = 0 /* Normal */) {
|
|
71557
|
-
var
|
|
71512
|
+
var _a;
|
|
71558
71513
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
71559
71514
|
checkGrammarObjectLiteralExpression(node, inDestructuringPattern);
|
|
71560
71515
|
const allPropertiesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
@@ -71695,7 +71650,7 @@ function createTypeChecker(host) {
|
|
|
71695
71650
|
for (const prop of getPropertiesOfType(contextualType)) {
|
|
71696
71651
|
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
71697
71652
|
if (!(prop.flags & 16777216 /* Optional */)) {
|
|
71698
|
-
error(prop.valueDeclaration || ((
|
|
71653
|
+
error(prop.valueDeclaration || ((_a = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a.links.bindingElement), Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
|
|
71699
71654
|
}
|
|
71700
71655
|
propertiesTable.set(prop.escapedName, prop);
|
|
71701
71656
|
propertiesArray.push(prop);
|
|
@@ -72159,7 +72114,7 @@ function createTypeChecker(host) {
|
|
|
72159
72114
|
}
|
|
72160
72115
|
}
|
|
72161
72116
|
function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
|
|
72162
|
-
var
|
|
72117
|
+
var _a;
|
|
72163
72118
|
Debug.assert(isJsxIntrinsicTagName(node.tagName));
|
|
72164
72119
|
const links = getNodeLinks(node);
|
|
72165
72120
|
if (!links.resolvedJsxElementAttributesType) {
|
|
@@ -72168,7 +72123,7 @@ function createTypeChecker(host) {
|
|
|
72168
72123
|
return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
|
|
72169
72124
|
} else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
|
|
72170
72125
|
const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
|
|
72171
|
-
return links.resolvedJsxElementAttributesType = ((
|
|
72126
|
+
return links.resolvedJsxElementAttributesType = ((_a = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName)) == null ? void 0 : _a.type) || errorType;
|
|
72172
72127
|
} else {
|
|
72173
72128
|
return links.resolvedJsxElementAttributesType = errorType;
|
|
72174
72129
|
}
|
|
@@ -72345,7 +72300,7 @@ function createTypeChecker(host) {
|
|
|
72345
72300
|
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
|
|
72346
72301
|
}
|
|
72347
72302
|
function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
|
|
72348
|
-
var
|
|
72303
|
+
var _a;
|
|
72349
72304
|
const flags = getDeclarationModifierFlagsFromSymbol(prop, writing);
|
|
72350
72305
|
if (isSuper) {
|
|
72351
72306
|
if (languageVersion < 2 /* ES2015 */) {
|
|
@@ -72362,7 +72317,7 @@ function createTypeChecker(host) {
|
|
|
72362
72317
|
}
|
|
72363
72318
|
return false;
|
|
72364
72319
|
}
|
|
72365
|
-
if (!(flags & 256 /* Static */) && ((
|
|
72320
|
+
if (!(flags & 256 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassInstanceProperty))) {
|
|
72366
72321
|
if (errorNode) {
|
|
72367
72322
|
error(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
72368
72323
|
}
|
|
@@ -72749,7 +72704,7 @@ function createTypeChecker(host) {
|
|
|
72749
72704
|
error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
|
|
72750
72705
|
}
|
|
72751
72706
|
propType = indexInfo.type;
|
|
72752
|
-
if (noUncheckedIndexedAccess && getAssignmentTargetKind(node) !== 1 /* Definite */) {
|
|
72707
|
+
if (compilerOptions.noUncheckedIndexedAccess && getAssignmentTargetKind(node) !== 1 /* Definite */) {
|
|
72753
72708
|
propType = getUnionType([propType, missingType]);
|
|
72754
72709
|
}
|
|
72755
72710
|
if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
|
|
@@ -72776,12 +72731,12 @@ function createTypeChecker(host) {
|
|
|
72776
72731
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
72777
72732
|
}
|
|
72778
72733
|
function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
|
|
72779
|
-
var
|
|
72734
|
+
var _a;
|
|
72780
72735
|
const file = getSourceFileOfNode(node);
|
|
72781
72736
|
if (file) {
|
|
72782
72737
|
if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */)) {
|
|
72783
72738
|
const declarationFile = forEach(suggestion == null ? void 0 : suggestion.declarations, getSourceFileOfNode);
|
|
72784
|
-
const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((
|
|
72739
|
+
const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((_a = suggestion.valueDeclaration.heritageClauses) == null ? void 0 : _a.length) || classOrConstructorParameterIsDecorated(
|
|
72785
72740
|
/*useLegacyDecorators*/
|
|
72786
72741
|
false,
|
|
72787
72742
|
suggestion.valueDeclaration
|
|
@@ -73579,7 +73534,7 @@ function createTypeChecker(host) {
|
|
|
73579
73534
|
errorOutputContainer
|
|
73580
73535
|
);
|
|
73581
73536
|
function checkTagNameDoesNotExpectTooManyArguments() {
|
|
73582
|
-
var
|
|
73537
|
+
var _a;
|
|
73583
73538
|
if (getJsxNamespaceContainerForImplicitImport(node)) {
|
|
73584
73539
|
return true;
|
|
73585
73540
|
}
|
|
@@ -73645,7 +73600,7 @@ function createTypeChecker(host) {
|
|
|
73645
73600
|
}
|
|
73646
73601
|
if (reportErrors2) {
|
|
73647
73602
|
const diag2 = createDiagnosticForNode(node.tagName, Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, entityNameToString(node.tagName), absoluteMinArgCount, entityNameToString(factory2), maxParamCount);
|
|
73648
|
-
const tagNameDeclaration = (
|
|
73603
|
+
const tagNameDeclaration = (_a = getSymbolAtLocation(node.tagName)) == null ? void 0 : _a.valueDeclaration;
|
|
73649
73604
|
if (tagNameDeclaration) {
|
|
73650
73605
|
addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics._0_is_declared_here, entityNameToString(node.tagName)));
|
|
73651
73606
|
}
|
|
@@ -73794,9 +73749,9 @@ function createTypeChecker(host) {
|
|
|
73794
73749
|
const spreadType = arg.kind === 230 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
73795
73750
|
if (spreadType && isTupleType(spreadType)) {
|
|
73796
73751
|
forEach(getElementTypes(spreadType), (t, i2) => {
|
|
73797
|
-
var
|
|
73752
|
+
var _a;
|
|
73798
73753
|
const flags = spreadType.target.elementFlags[i2];
|
|
73799
|
-
const syntheticArg = createSyntheticExpression(arg, flags & 4 /* Rest */ ? createArrayType(t) : t, !!(flags & 12 /* Variable */), (
|
|
73754
|
+
const syntheticArg = createSyntheticExpression(arg, flags & 4 /* Rest */ ? createArrayType(t) : t, !!(flags & 12 /* Variable */), (_a = spreadType.target.labeledElementDeclarations) == null ? void 0 : _a[i2]);
|
|
73800
73755
|
effectiveArgs.push(syntheticArg);
|
|
73801
73756
|
});
|
|
73802
73757
|
} else {
|
|
@@ -73904,7 +73859,7 @@ function createTypeChecker(host) {
|
|
|
73904
73859
|
return constructorSymbol === globalPromiseSymbol;
|
|
73905
73860
|
}
|
|
73906
73861
|
function getArgumentArityError(node, signatures, args, headMessage) {
|
|
73907
|
-
var
|
|
73862
|
+
var _a;
|
|
73908
73863
|
const spreadIndex = getSpreadArgumentIndex(args);
|
|
73909
73864
|
if (spreadIndex > -1) {
|
|
73910
73865
|
return createDiagnosticForNode(args[spreadIndex], Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);
|
|
@@ -73963,7 +73918,7 @@ function createTypeChecker(host) {
|
|
|
73963
73918
|
} else {
|
|
73964
73919
|
diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length);
|
|
73965
73920
|
}
|
|
73966
|
-
const parameter = (
|
|
73921
|
+
const parameter = (_a = closestSignature == null ? void 0 : closestSignature.declaration) == null ? void 0 : _a.parameters[closestSignature.thisParameter ? args.length + 1 : args.length];
|
|
73967
73922
|
if (parameter) {
|
|
73968
73923
|
const messageAndArgs = isBindingPattern(parameter.name) ? [Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided] : isRestParameter(parameter) ? [Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided, idText(getFirstIdentifier(parameter.name))] : [Diagnostics.An_argument_for_0_was_not_provided, !parameter.name ? args.length : idText(getFirstIdentifier(parameter.name))];
|
|
73969
73924
|
const parameterError = createDiagnosticForNode(parameter, ...messageAndArgs);
|
|
@@ -74203,11 +74158,11 @@ function createTypeChecker(host) {
|
|
|
74203
74158
|
}
|
|
74204
74159
|
return result;
|
|
74205
74160
|
function addImplementationSuccessElaboration(failed, diagnostic) {
|
|
74206
|
-
var
|
|
74161
|
+
var _a, _b;
|
|
74207
74162
|
const oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
74208
74163
|
const oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
74209
74164
|
const oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
74210
|
-
const failedSignatureDeclarations = ((_b = (
|
|
74165
|
+
const failedSignatureDeclarations = ((_b = (_a = failed.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.declarations) || emptyArray;
|
|
74211
74166
|
const isOverload = failedSignatureDeclarations.length > 1;
|
|
74212
74167
|
const implDecl = isOverload ? find(failedSignatureDeclarations, (d) => isFunctionLikeDeclaration(d) && nodeIsPresent(d.body)) : void 0;
|
|
74213
74168
|
if (implDecl) {
|
|
@@ -74222,7 +74177,7 @@ function createTypeChecker(host) {
|
|
|
74222
74177
|
candidateForTypeArgumentError = oldCandidateForTypeArgumentError;
|
|
74223
74178
|
}
|
|
74224
74179
|
function chooseOverload(candidates2, relation, isSingleNonGenericCandidate2, signatureHelpTrailingComma2 = false) {
|
|
74225
|
-
var
|
|
74180
|
+
var _a, _b;
|
|
74226
74181
|
candidatesForArgumentError = void 0;
|
|
74227
74182
|
candidateForArgumentArityError = void 0;
|
|
74228
74183
|
candidateForTypeArgumentError = void 0;
|
|
@@ -74257,7 +74212,7 @@ function createTypeChecker(host) {
|
|
|
74257
74212
|
let checkCandidate;
|
|
74258
74213
|
let inferenceContext;
|
|
74259
74214
|
if (candidate.typeParameters) {
|
|
74260
|
-
const paramLocation = (_b = (
|
|
74215
|
+
const paramLocation = (_b = (_a = candidate.typeParameters[0].symbol.declarations) == null ? void 0 : _a[0]) == null ? void 0 : _b.parent;
|
|
74261
74216
|
const candidateParameterContext = paramLocation || (candidate.declaration && isConstructorDeclaration(candidate.declaration) ? candidate.declaration.parent : candidate.declaration);
|
|
74262
74217
|
if (candidateParameterContext && findAncestor(node, (a) => a === candidateParameterContext)) {
|
|
74263
74218
|
candidate = getImplementationSignature(candidate);
|
|
@@ -74946,7 +74901,7 @@ function createTypeChecker(host) {
|
|
|
74946
74901
|
return result;
|
|
74947
74902
|
}
|
|
74948
74903
|
function isJSConstructor(node) {
|
|
74949
|
-
var
|
|
74904
|
+
var _a;
|
|
74950
74905
|
if (!node || !isInJSFile(node)) {
|
|
74951
74906
|
return false;
|
|
74952
74907
|
}
|
|
@@ -74957,12 +74912,12 @@ function createTypeChecker(host) {
|
|
|
74957
74912
|
if (isPropertyAssignment(walkUpParenthesizedExpressions(func.parent)))
|
|
74958
74913
|
return false;
|
|
74959
74914
|
const symbol = getSymbolOfDeclaration(func);
|
|
74960
|
-
return !!((
|
|
74915
|
+
return !!((_a = symbol == null ? void 0 : symbol.members) == null ? void 0 : _a.size);
|
|
74961
74916
|
}
|
|
74962
74917
|
return false;
|
|
74963
74918
|
}
|
|
74964
74919
|
function mergeJSSymbols(target, source) {
|
|
74965
|
-
var
|
|
74920
|
+
var _a, _b;
|
|
74966
74921
|
if (source) {
|
|
74967
74922
|
const links = getSymbolLinks(source);
|
|
74968
74923
|
if (!links.inferredClassSymbol || !links.inferredClassSymbol.has(getSymbolId(target))) {
|
|
@@ -74970,7 +74925,7 @@ function createTypeChecker(host) {
|
|
|
74970
74925
|
inferred.exports = inferred.exports || createSymbolTable();
|
|
74971
74926
|
inferred.members = inferred.members || createSymbolTable();
|
|
74972
74927
|
inferred.flags |= source.flags & 32 /* Class */;
|
|
74973
|
-
if ((
|
|
74928
|
+
if ((_a = source.exports) == null ? void 0 : _a.size) {
|
|
74974
74929
|
mergeSymbolTable(inferred.exports, source.exports);
|
|
74975
74930
|
}
|
|
74976
74931
|
if ((_b = source.members) == null ? void 0 : _b.size) {
|
|
@@ -74983,13 +74938,13 @@ function createTypeChecker(host) {
|
|
|
74983
74938
|
}
|
|
74984
74939
|
}
|
|
74985
74940
|
function getAssignedClassSymbol(decl) {
|
|
74986
|
-
var
|
|
74941
|
+
var _a;
|
|
74987
74942
|
const assignmentSymbol = decl && getSymbolOfExpando(
|
|
74988
74943
|
decl,
|
|
74989
74944
|
/*allowDeclaration*/
|
|
74990
74945
|
true
|
|
74991
74946
|
);
|
|
74992
|
-
const prototype = (
|
|
74947
|
+
const prototype = (_a = assignmentSymbol == null ? void 0 : assignmentSymbol.exports) == null ? void 0 : _a.get("prototype");
|
|
74993
74948
|
const init = (prototype == null ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration);
|
|
74994
74949
|
return init ? getSymbolOfDeclaration(init) : void 0;
|
|
74995
74950
|
}
|
|
@@ -75046,7 +75001,7 @@ function createTypeChecker(host) {
|
|
|
75046
75001
|
}
|
|
75047
75002
|
}
|
|
75048
75003
|
function checkCallExpression(node, checkMode) {
|
|
75049
|
-
var
|
|
75004
|
+
var _a, _b, _c;
|
|
75050
75005
|
checkGrammarTypeArguments(node, node.typeArguments);
|
|
75051
75006
|
const signature = getResolvedSignature(
|
|
75052
75007
|
node,
|
|
@@ -75063,7 +75018,7 @@ function createTypeChecker(host) {
|
|
|
75063
75018
|
}
|
|
75064
75019
|
if (node.kind === 214 /* NewExpression */) {
|
|
75065
75020
|
const declaration = signature.declaration;
|
|
75066
|
-
if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (
|
|
75021
|
+
if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a = getJSDocRoot(declaration)) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 176 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
|
|
75067
75022
|
if (noImplicitAny) {
|
|
75068
75023
|
error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
|
|
75069
75024
|
}
|
|
@@ -75222,11 +75177,11 @@ function createTypeChecker(host) {
|
|
|
75222
75177
|
return void 0;
|
|
75223
75178
|
}
|
|
75224
75179
|
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
|
|
75225
|
-
var
|
|
75180
|
+
var _a;
|
|
75226
75181
|
if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
|
|
75227
75182
|
const synthType = type;
|
|
75228
75183
|
if (!synthType.syntheticType) {
|
|
75229
|
-
const file = (
|
|
75184
|
+
const file = (_a = originalSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
75230
75185
|
const hasSyntheticDefault = canHaveSyntheticDefault(
|
|
75231
75186
|
file,
|
|
75232
75187
|
originalSymbol,
|
|
@@ -75560,8 +75515,8 @@ function createTypeChecker(host) {
|
|
|
75560
75515
|
return restParameter.escapedName;
|
|
75561
75516
|
}
|
|
75562
75517
|
function getParameterIdentifierInfoAtPosition(signature, pos) {
|
|
75563
|
-
var
|
|
75564
|
-
if (((
|
|
75518
|
+
var _a;
|
|
75519
|
+
if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 317 /* JSDocFunctionType */) {
|
|
75565
75520
|
return void 0;
|
|
75566
75521
|
}
|
|
75567
75522
|
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
@@ -76671,7 +76626,7 @@ function createTypeChecker(host) {
|
|
|
76671
76626
|
return !!(getCheckFlags(symbol) & 8 /* Readonly */ || symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) & 8 /* Readonly */ || symbol.flags & 3 /* Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 6 /* Constant */ || symbol.flags & 98304 /* Accessor */ && !(symbol.flags & 65536 /* SetAccessor */) || symbol.flags & 8 /* EnumMember */ || some(symbol.declarations, isReadonlyAssignmentDeclaration));
|
|
76672
76627
|
}
|
|
76673
76628
|
function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) {
|
|
76674
|
-
var
|
|
76629
|
+
var _a, _b;
|
|
76675
76630
|
if (assignmentKind === 0 /* None */) {
|
|
76676
76631
|
return false;
|
|
76677
76632
|
}
|
|
@@ -76685,7 +76640,7 @@ function createTypeChecker(host) {
|
|
|
76685
76640
|
const isAssignmentDeclaration2 = isBinaryExpression(symbol.valueDeclaration);
|
|
76686
76641
|
const isLocalPropertyDeclaration = ctor.parent === symbol.valueDeclaration.parent;
|
|
76687
76642
|
const isLocalParameterProperty = ctor === symbol.valueDeclaration.parent;
|
|
76688
|
-
const isLocalThisPropertyAssignment = isAssignmentDeclaration2 && ((
|
|
76643
|
+
const isLocalThisPropertyAssignment = isAssignmentDeclaration2 && ((_a = symbol.parent) == null ? void 0 : _a.valueDeclaration) === ctor.parent;
|
|
76689
76644
|
const isLocalThisPropertyAssignmentConstructorFunction = isAssignmentDeclaration2 && ((_b = symbol.parent) == null ? void 0 : _b.valueDeclaration) === ctor;
|
|
76690
76645
|
const isWriteableSymbol = isLocalPropertyDeclaration || isLocalParameterProperty || isLocalThisPropertyAssignment || isLocalThisPropertyAssignmentConstructorFunction;
|
|
76691
76646
|
return !isWriteableSymbol;
|
|
@@ -77083,7 +77038,7 @@ function createTypeChecker(host) {
|
|
|
77083
77038
|
checkExternalEmitHelpers(node, 512 /* Read */);
|
|
77084
77039
|
}
|
|
77085
77040
|
const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType;
|
|
77086
|
-
let inBoundsType = noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType;
|
|
77041
|
+
let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType;
|
|
77087
77042
|
for (let i = 0; i < elements.length; i++) {
|
|
77088
77043
|
let type = possiblyOutOfBoundsType;
|
|
77089
77044
|
if (node.elements[i].kind === 230 /* SpreadElement */) {
|
|
@@ -77672,7 +77627,7 @@ function createTypeChecker(host) {
|
|
|
77672
77627
|
}
|
|
77673
77628
|
}
|
|
77674
77629
|
function isAssignmentDeclaration2(kind) {
|
|
77675
|
-
var
|
|
77630
|
+
var _a;
|
|
77676
77631
|
switch (kind) {
|
|
77677
77632
|
case 2 /* ModuleExports */:
|
|
77678
77633
|
return true;
|
|
@@ -77683,7 +77638,7 @@ function createTypeChecker(host) {
|
|
|
77683
77638
|
case 4 /* ThisProperty */:
|
|
77684
77639
|
const symbol = getSymbolOfNode(left);
|
|
77685
77640
|
const init = getAssignedExpandoInitializer(right);
|
|
77686
|
-
return !!init && isObjectLiteralExpression(init) && !!((
|
|
77641
|
+
return !!init && isObjectLiteralExpression(init) && !!((_a = symbol == null ? void 0 : symbol.exports) == null ? void 0 : _a.size);
|
|
77687
77642
|
default:
|
|
77688
77643
|
return false;
|
|
77689
77644
|
}
|
|
@@ -78233,8 +78188,8 @@ function createTypeChecker(host) {
|
|
|
78233
78188
|
return type;
|
|
78234
78189
|
}
|
|
78235
78190
|
function checkExpression(node, checkMode, forceTuple) {
|
|
78236
|
-
var
|
|
78237
|
-
(
|
|
78191
|
+
var _a, _b;
|
|
78192
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Check, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
78238
78193
|
const saveCurrentNode = currentNode;
|
|
78239
78194
|
currentNode = node;
|
|
78240
78195
|
instantiationCount = 0;
|
|
@@ -78409,7 +78364,7 @@ function createTypeChecker(host) {
|
|
|
78409
78364
|
addLazyDiagnostic(() => checkTypeNameIsReserved(node.name, Diagnostics.Type_parameter_name_cannot_be_0));
|
|
78410
78365
|
}
|
|
78411
78366
|
function checkTypeParameterDeferred(node) {
|
|
78412
|
-
var
|
|
78367
|
+
var _a, _b;
|
|
78413
78368
|
if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) {
|
|
78414
78369
|
const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node));
|
|
78415
78370
|
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
@@ -78418,7 +78373,7 @@ function createTypeChecker(host) {
|
|
|
78418
78373
|
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
78419
78374
|
error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
78420
78375
|
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
78421
|
-
(
|
|
78376
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
78422
78377
|
const source = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSubTypeForCheck : markerSuperTypeForCheck);
|
|
78423
78378
|
const target = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSuperTypeForCheck : markerSubTypeForCheck);
|
|
78424
78379
|
const saveVarianceTypeParameter = typeParameter;
|
|
@@ -79128,8 +79083,8 @@ function createTypeChecker(host) {
|
|
|
79128
79083
|
}
|
|
79129
79084
|
}
|
|
79130
79085
|
function checkGrammarMappedType(node) {
|
|
79131
|
-
var
|
|
79132
|
-
if ((
|
|
79086
|
+
var _a;
|
|
79087
|
+
if ((_a = node.members) == null ? void 0 : _a.length) {
|
|
79133
79088
|
return grammarErrorOnNode(node.members[0], Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);
|
|
79134
79089
|
}
|
|
79135
79090
|
}
|
|
@@ -79563,13 +79518,13 @@ function createTypeChecker(host) {
|
|
|
79563
79518
|
return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0;
|
|
79564
79519
|
}
|
|
79565
79520
|
function isAwaitedTypeInstantiation(type) {
|
|
79566
|
-
var
|
|
79521
|
+
var _a;
|
|
79567
79522
|
if (type.flags & 16777216 /* Conditional */) {
|
|
79568
79523
|
const awaitedSymbol = getGlobalAwaitedSymbol(
|
|
79569
79524
|
/*reportErrors*/
|
|
79570
79525
|
false
|
|
79571
79526
|
);
|
|
79572
|
-
return !!awaitedSymbol && type.aliasSymbol === awaitedSymbol && ((
|
|
79527
|
+
return !!awaitedSymbol && type.aliasSymbol === awaitedSymbol && ((_a = type.aliasTypeArguments) == null ? void 0 : _a.length) === 1;
|
|
79573
79528
|
}
|
|
79574
79529
|
return false;
|
|
79575
79530
|
}
|
|
@@ -80155,7 +80110,7 @@ function createTypeChecker(host) {
|
|
|
80155
80110
|
}
|
|
80156
80111
|
}
|
|
80157
80112
|
function checkFunctionOrMethodDeclaration(node) {
|
|
80158
|
-
var
|
|
80113
|
+
var _a;
|
|
80159
80114
|
checkDecorators(node);
|
|
80160
80115
|
checkSignatureDeclaration(node);
|
|
80161
80116
|
const functionFlags = getFunctionFlags(node);
|
|
@@ -80165,7 +80120,7 @@ function createTypeChecker(host) {
|
|
|
80165
80120
|
if (hasBindableName(node)) {
|
|
80166
80121
|
const symbol = getSymbolOfDeclaration(node);
|
|
80167
80122
|
const localSymbol = node.localSymbol || symbol;
|
|
80168
|
-
const firstDeclaration = (
|
|
80123
|
+
const firstDeclaration = (_a = localSymbol.declarations) == null ? void 0 : _a.find(
|
|
80169
80124
|
// Get first non javascript function declaration
|
|
80170
80125
|
(declaration) => declaration.kind === node.kind && !(declaration.flags & 524288 /* JavaScriptFile */)
|
|
80171
80126
|
);
|
|
@@ -80439,9 +80394,9 @@ function createTypeChecker(host) {
|
|
|
80439
80394
|
});
|
|
80440
80395
|
}
|
|
80441
80396
|
function checkPotentialUncheckedRenamedBindingElementsInTypes() {
|
|
80442
|
-
var
|
|
80397
|
+
var _a;
|
|
80443
80398
|
for (const node of potentialUnusedRenamedBindingElementsInTypes) {
|
|
80444
|
-
if (!((
|
|
80399
|
+
if (!((_a = getSymbolOfDeclaration(node)) == null ? void 0 : _a.isReferenced)) {
|
|
80445
80400
|
const wrappingDeclaration = walkUpBindingElementsAndPatterns(node);
|
|
80446
80401
|
Debug.assert(isPartOfParameterDeclaration(wrappingDeclaration), "Only parameter declaration should be checked here");
|
|
80447
80402
|
const diagnostic = createDiagnosticForNode(node.name, Diagnostics._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation, declarationNameToString(node.name), declarationNameToString(node.propertyName));
|
|
@@ -80664,7 +80619,7 @@ function createTypeChecker(host) {
|
|
|
80664
80619
|
return type === autoType ? anyType : type === autoArrayType ? anyArrayType : type;
|
|
80665
80620
|
}
|
|
80666
80621
|
function checkVariableLikeDeclaration(node) {
|
|
80667
|
-
var
|
|
80622
|
+
var _a;
|
|
80668
80623
|
checkDecorators(node);
|
|
80669
80624
|
if (!isBindingElement(node)) {
|
|
80670
80625
|
checkSourceElement(node.type);
|
|
@@ -80763,7 +80718,7 @@ function createTypeChecker(host) {
|
|
|
80763
80718
|
if (node === symbol.valueDeclaration) {
|
|
80764
80719
|
const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node);
|
|
80765
80720
|
if (initializer) {
|
|
80766
|
-
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((
|
|
80721
|
+
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a = symbol.exports) == null ? void 0 : _a.size);
|
|
80767
80722
|
if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 249 /* ForInStatement */) {
|
|
80768
80723
|
const initializerType = checkExpressionCached(initializer);
|
|
80769
80724
|
checkTypeAssignableToAndOptionallyElaborate(
|
|
@@ -80858,8 +80813,8 @@ function createTypeChecker(host) {
|
|
|
80858
80813
|
return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
80859
80814
|
}
|
|
80860
80815
|
function checkVariableDeclaration(node) {
|
|
80861
|
-
var
|
|
80862
|
-
(
|
|
80816
|
+
var _a, _b;
|
|
80817
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Check, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
80863
80818
|
checkGrammarVariableDeclaration(node);
|
|
80864
80819
|
checkVariableLikeDeclaration(node);
|
|
80865
80820
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
@@ -81137,7 +81092,7 @@ function createTypeChecker(host) {
|
|
|
81137
81092
|
}
|
|
81138
81093
|
const uplevelIteration = languageVersion >= 2 /* ES2015 */;
|
|
81139
81094
|
const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
|
|
81140
|
-
const possibleOutOfBounds = noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */);
|
|
81095
|
+
const possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */);
|
|
81141
81096
|
if (uplevelIteration || downlevelIteration || allowAsyncIterables) {
|
|
81142
81097
|
const iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : void 0);
|
|
81143
81098
|
if (checkAssignability) {
|
|
@@ -81186,14 +81141,14 @@ function createTypeChecker(host) {
|
|
|
81186
81141
|
}
|
|
81187
81142
|
const arrayElementType = getIndexTypeOfType(arrayType, numberType);
|
|
81188
81143
|
if (hasStringConstituent && arrayElementType) {
|
|
81189
|
-
if (arrayElementType.flags & 402653316 /* StringLike */ && !noUncheckedIndexedAccess) {
|
|
81144
|
+
if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) {
|
|
81190
81145
|
return stringType;
|
|
81191
81146
|
}
|
|
81192
81147
|
return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */);
|
|
81193
81148
|
}
|
|
81194
81149
|
return use & 128 /* PossiblyOutOfBounds */ ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType;
|
|
81195
81150
|
function getIterationDiagnosticDetails(allowsStrings, downlevelIteration2) {
|
|
81196
|
-
var
|
|
81151
|
+
var _a;
|
|
81197
81152
|
if (downlevelIteration2) {
|
|
81198
81153
|
return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true] : [Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true];
|
|
81199
81154
|
}
|
|
@@ -81207,7 +81162,7 @@ function createTypeChecker(host) {
|
|
|
81207
81162
|
if (yieldType) {
|
|
81208
81163
|
return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false];
|
|
81209
81164
|
}
|
|
81210
|
-
if (isES2015OrLaterIterable((
|
|
81165
|
+
if (isES2015OrLaterIterable((_a = inputType.symbol) == null ? void 0 : _a.escapedName)) {
|
|
81211
81166
|
return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, true];
|
|
81212
81167
|
}
|
|
81213
81168
|
return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true] : [Diagnostics.Type_0_is_not_an_array_type, true];
|
|
@@ -81279,7 +81234,7 @@ function createTypeChecker(host) {
|
|
|
81279
81234
|
return type[cacheKey] = cachedTypes2;
|
|
81280
81235
|
}
|
|
81281
81236
|
function getIterationTypesOfIterable(type, use, errorNode) {
|
|
81282
|
-
var
|
|
81237
|
+
var _a, _b;
|
|
81283
81238
|
if (isTypeAny(type)) {
|
|
81284
81239
|
return anyIterationTypes;
|
|
81285
81240
|
}
|
|
@@ -81294,7 +81249,7 @@ function createTypeChecker(host) {
|
|
|
81294
81249
|
}
|
|
81295
81250
|
}
|
|
81296
81251
|
return void 0;
|
|
81297
|
-
} else if ((
|
|
81252
|
+
} else if ((_a = errorOutputContainer == null ? void 0 : errorOutputContainer.errors) == null ? void 0 : _a.length) {
|
|
81298
81253
|
for (const diag2 of errorOutputContainer.errors) {
|
|
81299
81254
|
diagnostics.add(diag2);
|
|
81300
81255
|
}
|
|
@@ -81602,7 +81557,7 @@ function createTypeChecker(host) {
|
|
|
81602
81557
|
));
|
|
81603
81558
|
}
|
|
81604
81559
|
function getIterationTypesOfMethod(type, resolver, methodName, errorNode, errorOutputContainer) {
|
|
81605
|
-
var
|
|
81560
|
+
var _a, _b, _c, _d;
|
|
81606
81561
|
const method = getPropertyOfType(type, methodName);
|
|
81607
81562
|
if (!method && methodName !== "next") {
|
|
81608
81563
|
return void 0;
|
|
@@ -81633,7 +81588,7 @@ function createTypeChecker(host) {
|
|
|
81633
81588
|
/*reportErrors*/
|
|
81634
81589
|
false
|
|
81635
81590
|
);
|
|
81636
|
-
const isGeneratorMethod = ((_b = (
|
|
81591
|
+
const isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) == null ? void 0 : _a.members) == null ? void 0 : _b.get(methodName)) === methodType.symbol;
|
|
81637
81592
|
const isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) == null ? void 0 : _c.members) == null ? void 0 : _d.get(methodName)) === methodType.symbol;
|
|
81638
81593
|
if (isGeneratorMethod || isIteratorMethod) {
|
|
81639
81594
|
const globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType;
|
|
@@ -82505,7 +82460,7 @@ function createTypeChecker(host) {
|
|
|
82505
82460
|
return filter(symbol.declarations, (d) => d.kind === 263 /* ClassDeclaration */ || d.kind === 264 /* InterfaceDeclaration */);
|
|
82506
82461
|
}
|
|
82507
82462
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
82508
|
-
var
|
|
82463
|
+
var _a, _b, _c, _d, _e;
|
|
82509
82464
|
const baseProperties = getPropertiesOfType(baseType);
|
|
82510
82465
|
const notImplementedInfo = /* @__PURE__ */ new Map();
|
|
82511
82466
|
basePropertyCheck:
|
|
@@ -82536,7 +82491,7 @@ function createTypeChecker(host) {
|
|
|
82536
82491
|
const baseTypeName = typeToString(baseType);
|
|
82537
82492
|
const typeName = typeToString(type);
|
|
82538
82493
|
const basePropertyName = symbolToString(baseProperty);
|
|
82539
|
-
const missedProperties = append((
|
|
82494
|
+
const missedProperties = append((_a = notImplementedInfo.get(derivedClassDecl)) == null ? void 0 : _a.missedProperties, basePropertyName);
|
|
82540
82495
|
notImplementedInfo.set(derivedClassDecl, { baseTypeName, typeName, missedProperties });
|
|
82541
82496
|
}
|
|
82542
82497
|
} else {
|
|
@@ -82548,7 +82503,7 @@ function createTypeChecker(host) {
|
|
|
82548
82503
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
82549
82504
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
82550
82505
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
82551
|
-
if ((getCheckFlags(base) & 6 /*
|
|
82506
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_b = base.declarations) == null ? void 0 : _b.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_c = base.declarations) == null ? void 0 : _c.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
82552
82507
|
continue;
|
|
82553
82508
|
}
|
|
82554
82509
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -83029,7 +82984,7 @@ function createTypeChecker(host) {
|
|
|
83029
82984
|
}
|
|
83030
82985
|
addLazyDiagnostic(checkModuleDeclarationDiagnostics);
|
|
83031
82986
|
function checkModuleDeclarationDiagnostics() {
|
|
83032
|
-
var
|
|
82987
|
+
var _a, _b;
|
|
83033
82988
|
const isGlobalAugmentation = isGlobalScopeAugmentation(node);
|
|
83034
82989
|
const inAmbientContext = node.flags & 33554432 /* Ambient */;
|
|
83035
82990
|
if (isGlobalAugmentation && !inAmbientContext) {
|
|
@@ -83054,7 +83009,7 @@ function createTypeChecker(host) {
|
|
|
83054
83009
|
if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) {
|
|
83055
83010
|
error(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName);
|
|
83056
83011
|
}
|
|
83057
|
-
if (((
|
|
83012
|
+
if (((_a = symbol.declarations) == null ? void 0 : _a.length) > 1) {
|
|
83058
83013
|
const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
|
83059
83014
|
if (firstNonAmbientClassOrFunc) {
|
|
83060
83015
|
if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
|
@@ -83191,7 +83146,7 @@ function createTypeChecker(host) {
|
|
|
83191
83146
|
return true;
|
|
83192
83147
|
}
|
|
83193
83148
|
function checkAliasSymbol(node) {
|
|
83194
|
-
var
|
|
83149
|
+
var _a, _b, _c, _d;
|
|
83195
83150
|
let symbol = getSymbolOfDeclaration(node);
|
|
83196
83151
|
const target = resolveAlias(symbol);
|
|
83197
83152
|
if (target !== unknownSymbol) {
|
|
@@ -83201,7 +83156,7 @@ function createTypeChecker(host) {
|
|
|
83201
83156
|
Debug.assert(node.kind !== 280 /* NamespaceExport */);
|
|
83202
83157
|
if (node.kind === 281 /* ExportSpecifier */) {
|
|
83203
83158
|
const diag2 = error(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
|
|
83204
|
-
const alreadyExportedSymbol = (_b = (
|
|
83159
|
+
const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText);
|
|
83205
83160
|
if (alreadyExportedSymbol === target) {
|
|
83206
83161
|
const exportingDeclaration = (_c = alreadyExportedSymbol.declarations) == null ? void 0 : _c.find(isJSDocNode);
|
|
83207
83162
|
if (exportingDeclaration) {
|
|
@@ -83328,7 +83283,7 @@ function createTypeChecker(host) {
|
|
|
83328
83283
|
}
|
|
83329
83284
|
}
|
|
83330
83285
|
function checkImportAttributes(declaration) {
|
|
83331
|
-
var
|
|
83286
|
+
var _a;
|
|
83332
83287
|
const node = declaration.attributes;
|
|
83333
83288
|
if (node) {
|
|
83334
83289
|
const importAttributesType = getGlobalImportAttributesType(
|
|
@@ -83349,7 +83304,7 @@ function createTypeChecker(host) {
|
|
|
83349
83304
|
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve;
|
|
83350
83305
|
return grammarErrorOnNode(node, message);
|
|
83351
83306
|
}
|
|
83352
|
-
const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (
|
|
83307
|
+
const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly);
|
|
83353
83308
|
if (isTypeOnly) {
|
|
83354
83309
|
return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
83355
83310
|
}
|
|
@@ -83462,8 +83417,8 @@ function createTypeChecker(host) {
|
|
|
83462
83417
|
checkImportAttributes(node);
|
|
83463
83418
|
}
|
|
83464
83419
|
function checkGrammarExportDeclaration(node) {
|
|
83465
|
-
var
|
|
83466
|
-
if (node.isTypeOnly && ((
|
|
83420
|
+
var _a;
|
|
83421
|
+
if (node.isTypeOnly && ((_a = node.exportClause) == null ? void 0 : _a.kind) === 279 /* NamedExports */) {
|
|
83467
83422
|
return checkGrammarNamedImportsOrExports(node.exportClause);
|
|
83468
83423
|
}
|
|
83469
83424
|
return false;
|
|
@@ -83965,8 +83920,8 @@ function createTypeChecker(host) {
|
|
|
83965
83920
|
links.deferredNodes = void 0;
|
|
83966
83921
|
}
|
|
83967
83922
|
function checkDeferredNode(node) {
|
|
83968
|
-
var
|
|
83969
|
-
(
|
|
83923
|
+
var _a, _b;
|
|
83924
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Check, "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
83970
83925
|
const saveCurrentNode = currentNode;
|
|
83971
83926
|
currentNode = node;
|
|
83972
83927
|
instantiationCount = 0;
|
|
@@ -84018,8 +83973,8 @@ function createTypeChecker(host) {
|
|
|
84018
83973
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
84019
83974
|
}
|
|
84020
83975
|
function checkSourceFile(node) {
|
|
84021
|
-
var
|
|
84022
|
-
(
|
|
83976
|
+
var _a, _b;
|
|
83977
|
+
(_a = tracing) == null ? void 0 : _a.push(
|
|
84023
83978
|
tracing.Phase.Check,
|
|
84024
83979
|
"checkSourceFile",
|
|
84025
83980
|
{ path: node.path },
|
|
@@ -84813,7 +84768,7 @@ function createTypeChecker(host) {
|
|
|
84813
84768
|
return roots ? flatMap(roots, getRootSymbols) : [symbol];
|
|
84814
84769
|
}
|
|
84815
84770
|
function getImmediateRootSymbols(symbol) {
|
|
84816
|
-
if (getCheckFlags(symbol) & 6 /*
|
|
84771
|
+
if (getCheckFlags(symbol) & 6 /* Synthetic */) {
|
|
84817
84772
|
return mapDefined(getSymbolLinks(symbol).containingType.types, (type) => getPropertyOfType(type, symbol.escapedName));
|
|
84818
84773
|
} else if (symbol.flags & 33554432 /* Transient */) {
|
|
84819
84774
|
const { links: { leftSpread, rightSpread, syntheticOrigin } } = symbol;
|
|
@@ -84845,7 +84800,7 @@ function createTypeChecker(host) {
|
|
|
84845
84800
|
return isModuleOrEnumDeclaration(node.parent) && node === node.parent.name;
|
|
84846
84801
|
}
|
|
84847
84802
|
function getReferencedExportContainer(nodeIn, prefixLocals) {
|
|
84848
|
-
var
|
|
84803
|
+
var _a;
|
|
84849
84804
|
const node = getParseTreeNode(nodeIn, isIdentifier);
|
|
84850
84805
|
if (node) {
|
|
84851
84806
|
let symbol = getReferencedValueSymbol(
|
|
@@ -84863,7 +84818,7 @@ function createTypeChecker(host) {
|
|
|
84863
84818
|
}
|
|
84864
84819
|
const parentSymbol = getParentOfSymbol(symbol);
|
|
84865
84820
|
if (parentSymbol) {
|
|
84866
|
-
if (parentSymbol.flags & 512 /* ValueModule */ && ((
|
|
84821
|
+
if (parentSymbol.flags & 512 /* ValueModule */ && ((_a = parentSymbol.valueDeclaration) == null ? void 0 : _a.kind) === 307 /* SourceFile */) {
|
|
84867
84822
|
const symbolFile = parentSymbol.valueDeclaration;
|
|
84868
84823
|
const referenceFile = getSourceFileOfNode(node);
|
|
84869
84824
|
const symbolIsUmdExport = symbolFile !== referenceFile;
|
|
@@ -85090,11 +85045,11 @@ function createTypeChecker(host) {
|
|
|
85090
85045
|
return symbol && getPropertiesOfType(getTypeOfSymbol(symbol)) || emptyArray;
|
|
85091
85046
|
}
|
|
85092
85047
|
function getNodeCheckFlags(node) {
|
|
85093
|
-
var
|
|
85048
|
+
var _a;
|
|
85094
85049
|
const nodeId = node.id || 0;
|
|
85095
85050
|
if (nodeId < 0 || nodeId >= nodeLinks.length)
|
|
85096
85051
|
return 0;
|
|
85097
|
-
return ((
|
|
85052
|
+
return ((_a = nodeLinks[nodeId]) == null ? void 0 : _a.flags) || 0;
|
|
85098
85053
|
}
|
|
85099
85054
|
function getEnumMemberValue(node) {
|
|
85100
85055
|
computeEnumMemberValues(node.parent);
|
|
@@ -85129,7 +85084,7 @@ function createTypeChecker(host) {
|
|
|
85129
85084
|
return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0;
|
|
85130
85085
|
}
|
|
85131
85086
|
function getTypeReferenceSerializationKind(typeNameIn, location) {
|
|
85132
|
-
var
|
|
85087
|
+
var _a;
|
|
85133
85088
|
const typeName = getParseTreeNode(typeNameIn, isEntityName);
|
|
85134
85089
|
if (!typeName)
|
|
85135
85090
|
return 0 /* Unknown */;
|
|
@@ -85149,7 +85104,7 @@ function createTypeChecker(host) {
|
|
|
85149
85104
|
true,
|
|
85150
85105
|
location
|
|
85151
85106
|
);
|
|
85152
|
-
isTypeOnly = !!((
|
|
85107
|
+
isTypeOnly = !!((_a = rootValueSymbol == null ? void 0 : rootValueSymbol.declarations) == null ? void 0 : _a.every(isTypeOnlyImportOrExportDeclaration));
|
|
85153
85108
|
}
|
|
85154
85109
|
const valueSymbol = resolveEntityName(
|
|
85155
85110
|
typeName,
|
|
@@ -85861,7 +85816,7 @@ function createTypeChecker(host) {
|
|
|
85861
85816
|
return externalHelpersModule;
|
|
85862
85817
|
}
|
|
85863
85818
|
function checkGrammarModifiers(node) {
|
|
85864
|
-
var
|
|
85819
|
+
var _a;
|
|
85865
85820
|
const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node);
|
|
85866
85821
|
if (quickResult !== void 0) {
|
|
85867
85822
|
return quickResult;
|
|
@@ -86137,7 +86092,7 @@ function createTypeChecker(host) {
|
|
|
86137
86092
|
case 147 /* OutKeyword */: {
|
|
86138
86093
|
const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
|
|
86139
86094
|
const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
|
|
86140
|
-
const parent = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((
|
|
86095
|
+
const parent = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a = getJSDocRoot(node.parent)) == null ? void 0 : _a.tags, isJSDocTypedefTag)) || node.parent;
|
|
86141
86096
|
if (node.kind !== 168 /* TypeParameter */ || parent && !(isInterfaceDeclaration(parent) || isClassLike(parent) || isTypeAliasDeclaration(parent) || isJSDocTypedefTag(parent))) {
|
|
86142
86097
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
|
|
86143
86098
|
}
|
|
@@ -87214,11 +87169,11 @@ function createTypeChecker(host) {
|
|
|
87214
87169
|
return ambientModulesCache;
|
|
87215
87170
|
}
|
|
87216
87171
|
function checkGrammarImportClause(node) {
|
|
87217
|
-
var
|
|
87172
|
+
var _a;
|
|
87218
87173
|
if (node.isTypeOnly && node.name && node.namedBindings) {
|
|
87219
87174
|
return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
|
|
87220
87175
|
}
|
|
87221
|
-
if (node.isTypeOnly && ((
|
|
87176
|
+
if (node.isTypeOnly && ((_a = node.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamedImports */) {
|
|
87222
87177
|
return checkGrammarNamedImportsOrExports(node.namedBindings);
|
|
87223
87178
|
}
|
|
87224
87179
|
return false;
|
|
@@ -121854,9 +121809,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121854
121809
|
message = Diagnostics.File_is_library_specified_here;
|
|
121855
121810
|
break;
|
|
121856
121811
|
}
|
|
121857
|
-
const target = getEmitScriptTarget(options);
|
|
121858
|
-
|
|
121859
|
-
configFileNode = target === 2 /* ES2015 */ ? getOptionsSyntaxByValue("target", "es2015") ?? getOptionsSyntaxByValue("target", "es6") : targetText ? getOptionsSyntaxByValue("target", targetText) : void 0;
|
|
121812
|
+
const target = getNameOfScriptTarget(getEmitScriptTarget(options));
|
|
121813
|
+
configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0;
|
|
121860
121814
|
message = Diagnostics.File_is_default_library_for_target_specified_here;
|
|
121861
121815
|
break;
|
|
121862
121816
|
default:
|