@typescript-deploys/pr-build 5.4.0-pr-57293-15 → 5.4.0-pr-57345-8
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 +223 -253
- package/lib/tsserver.js +276 -270
- package/lib/typescript.d.ts +12 -13
- package/lib/typescript.js +278 -270
- package/lib/typingsInstaller.js +40 -41
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -2340,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2340
2340
|
|
|
2341
2341
|
// src/compiler/corePublic.ts
|
|
2342
2342
|
var versionMajorMinor = "5.4";
|
|
2343
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2343
|
+
var version = `${versionMajorMinor}.0-insiders.20240208`;
|
|
2344
2344
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2345
2345
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2346
2346
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4481,8 +4481,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
4481
4481
|
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
|
|
4482
4482
|
__tsDebuggerDisplay: {
|
|
4483
4483
|
value() {
|
|
4484
|
-
const typeHeader = this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags &
|
|
4485
|
-
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~
|
|
4484
|
+
const typeHeader = this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags & 1024 /* ReverseMapped */ ? "ReverseMappedType" : this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : "ObjectType" : "Type";
|
|
4485
|
+
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
|
|
4486
4486
|
return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`;
|
|
4487
4487
|
}
|
|
4488
4488
|
},
|
|
@@ -5680,7 +5680,7 @@ var tracingEnabled;
|
|
|
5680
5680
|
};
|
|
5681
5681
|
}
|
|
5682
5682
|
let reverseMappedProperties = {};
|
|
5683
|
-
if (objectFlags &
|
|
5683
|
+
if (objectFlags & 1024 /* ReverseMapped */) {
|
|
5684
5684
|
const reverseMappedType = type;
|
|
5685
5685
|
reverseMappedProperties = {
|
|
5686
5686
|
reverseMappedSourceType: (_l = reverseMappedType.source) == null ? void 0 : _l.id,
|
|
@@ -5689,7 +5689,7 @@ var tracingEnabled;
|
|
|
5689
5689
|
};
|
|
5690
5690
|
}
|
|
5691
5691
|
let evolvingArrayProperties = {};
|
|
5692
|
-
if (objectFlags &
|
|
5692
|
+
if (objectFlags & 256 /* EvolvingArray */) {
|
|
5693
5693
|
const evolvingArrayType = type;
|
|
5694
5694
|
evolvingArrayProperties = {
|
|
5695
5695
|
evolvingArrayElementType: evolvingArrayType.elementType.id,
|
|
@@ -6709,43 +6709,42 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
6709
6709
|
ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple";
|
|
6710
6710
|
ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous";
|
|
6711
6711
|
ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped";
|
|
6712
|
-
ObjectFlags3[ObjectFlags3["
|
|
6713
|
-
ObjectFlags3[ObjectFlags3["
|
|
6714
|
-
ObjectFlags3[ObjectFlags3["
|
|
6715
|
-
ObjectFlags3[ObjectFlags3["
|
|
6716
|
-
ObjectFlags3[ObjectFlags3["
|
|
6717
|
-
ObjectFlags3[ObjectFlags3["
|
|
6718
|
-
ObjectFlags3[ObjectFlags3["
|
|
6719
|
-
ObjectFlags3[ObjectFlags3["
|
|
6720
|
-
ObjectFlags3[ObjectFlags3["
|
|
6721
|
-
ObjectFlags3[ObjectFlags3["
|
|
6722
|
-
ObjectFlags3[ObjectFlags3["
|
|
6723
|
-
ObjectFlags3[ObjectFlags3["
|
|
6724
|
-
ObjectFlags3[ObjectFlags3["
|
|
6725
|
-
ObjectFlags3[ObjectFlags3["
|
|
6726
|
-
ObjectFlags3[ObjectFlags3["
|
|
6727
|
-
ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
|
|
6712
|
+
ObjectFlags3[ObjectFlags3["Instantiated"] = 64] = "Instantiated";
|
|
6713
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 128] = "ObjectLiteral";
|
|
6714
|
+
ObjectFlags3[ObjectFlags3["EvolvingArray"] = 256] = "EvolvingArray";
|
|
6715
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties";
|
|
6716
|
+
ObjectFlags3[ObjectFlags3["ReverseMapped"] = 1024] = "ReverseMapped";
|
|
6717
|
+
ObjectFlags3[ObjectFlags3["JsxAttributes"] = 2048] = "JsxAttributes";
|
|
6718
|
+
ObjectFlags3[ObjectFlags3["JSLiteral"] = 4096] = "JSLiteral";
|
|
6719
|
+
ObjectFlags3[ObjectFlags3["FreshLiteral"] = 8192] = "FreshLiteral";
|
|
6720
|
+
ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 16384] = "ArrayLiteral";
|
|
6721
|
+
ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 32768] = "PrimitiveUnion";
|
|
6722
|
+
ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 65536] = "ContainsWideningType";
|
|
6723
|
+
ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 131072] = "ContainsObjectOrArrayLiteral";
|
|
6724
|
+
ObjectFlags3[ObjectFlags3["NonInferrableType"] = 262144] = "NonInferrableType";
|
|
6725
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed";
|
|
6726
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables";
|
|
6728
6727
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
6729
|
-
ObjectFlags3[ObjectFlags3["RequiresWidening"] =
|
|
6730
|
-
ObjectFlags3[ObjectFlags3["PropagatingFlags"] =
|
|
6731
|
-
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] =
|
|
6732
|
-
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] =
|
|
6733
|
-
ObjectFlags3[ObjectFlags3["ContainsSpread"] =
|
|
6734
|
-
ObjectFlags3[ObjectFlags3["ObjectRestType"] =
|
|
6735
|
-
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] =
|
|
6736
|
-
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] =
|
|
6737
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] =
|
|
6738
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] =
|
|
6739
|
-
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] =
|
|
6740
|
-
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] =
|
|
6741
|
-
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] =
|
|
6742
|
-
ObjectFlags3[ObjectFlags3["IsGenericType"] =
|
|
6743
|
-
ObjectFlags3[ObjectFlags3["ContainsIntersections"] =
|
|
6744
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] =
|
|
6745
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] =
|
|
6746
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] =
|
|
6747
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] =
|
|
6748
|
-
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] =
|
|
6728
|
+
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening";
|
|
6729
|
+
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags";
|
|
6730
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 96] = "InstantiatedMapped";
|
|
6731
|
+
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask";
|
|
6732
|
+
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
6733
|
+
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
6734
|
+
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
|
|
6735
|
+
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
|
|
6736
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
|
|
6737
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
|
|
6738
|
+
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 2097152] = "IsGenericTypeComputed";
|
|
6739
|
+
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 4194304] = "IsGenericObjectType";
|
|
6740
|
+
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 8388608] = "IsGenericIndexType";
|
|
6741
|
+
ObjectFlags3[ObjectFlags3["IsGenericType"] = 12582912] = "IsGenericType";
|
|
6742
|
+
ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 16777216] = "ContainsIntersections";
|
|
6743
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 33554432] = "IsUnknownLikeUnionComputed";
|
|
6744
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion";
|
|
6745
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed";
|
|
6746
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 33554432] = "IsNeverIntersection";
|
|
6747
|
+
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 67108864] = "IsConstrainedTypeVariable";
|
|
6749
6748
|
return ObjectFlags3;
|
|
6750
6749
|
})(ObjectFlags || {});
|
|
6751
6750
|
var VarianceFlags = /* @__PURE__ */ ((VarianceFlags2) => {
|
|
@@ -21249,7 +21248,8 @@ function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtens
|
|
|
21249
21248
|
}
|
|
21250
21249
|
function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) {
|
|
21251
21250
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
21252
|
-
|
|
21251
|
+
const moduleResolutionIsNodeNext = 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */;
|
|
21252
|
+
if (preference === "js" || resolutionMode === 99 /* ESNext */ && moduleResolutionIsNodeNext) {
|
|
21253
21253
|
if (!shouldAllowImportingTsExtension(compilerOptions)) {
|
|
21254
21254
|
return 2 /* JsExtension */;
|
|
21255
21255
|
}
|
|
@@ -21267,16 +21267,19 @@ function getModuleSpecifierEndingPreference(preference, resolutionMode, compiler
|
|
|
21267
21267
|
return inferPreference();
|
|
21268
21268
|
function inferPreference() {
|
|
21269
21269
|
let usesJsExtensions = false;
|
|
21270
|
-
const specifiers = sourceFile.imports.length ? sourceFile.imports
|
|
21270
|
+
const specifiers = sourceFile.imports.length ? sourceFile.imports : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0]) : emptyArray;
|
|
21271
21271
|
for (const specifier of specifiers) {
|
|
21272
|
-
if (pathIsRelative(specifier)) {
|
|
21273
|
-
if (
|
|
21272
|
+
if (pathIsRelative(specifier.text)) {
|
|
21273
|
+
if (moduleResolutionIsNodeNext && resolutionMode === 1 /* CommonJS */ && getModeForUsageLocation(sourceFile, specifier, compilerOptions) === 99 /* ESNext */) {
|
|
21274
21274
|
continue;
|
|
21275
21275
|
}
|
|
21276
|
-
if (
|
|
21276
|
+
if (fileExtensionIsOneOf(specifier.text, extensionsNotSupportingExtensionlessResolution)) {
|
|
21277
|
+
continue;
|
|
21278
|
+
}
|
|
21279
|
+
if (hasTSFileExtension(specifier.text)) {
|
|
21277
21280
|
return 3 /* TsExtension */;
|
|
21278
21281
|
}
|
|
21279
|
-
if (hasJSFileExtension(specifier)) {
|
|
21282
|
+
if (hasJSFileExtension(specifier.text)) {
|
|
21280
21283
|
usesJsExtensions = true;
|
|
21281
21284
|
}
|
|
21282
21285
|
}
|
|
@@ -47318,9 +47321,11 @@ function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignatu
|
|
|
47318
47321
|
// src/compiler/_namespaces/ts.moduleSpecifiers.ts
|
|
47319
47322
|
var ts_moduleSpecifiers_exports = {};
|
|
47320
47323
|
__export(ts_moduleSpecifiers_exports, {
|
|
47324
|
+
RelativePreference: () => RelativePreference,
|
|
47321
47325
|
countPathComponents: () => countPathComponents,
|
|
47322
47326
|
forEachFileNameOfModule: () => forEachFileNameOfModule,
|
|
47323
47327
|
getModuleSpecifier: () => getModuleSpecifier,
|
|
47328
|
+
getModuleSpecifierPreferences: () => getModuleSpecifierPreferences,
|
|
47324
47329
|
getModuleSpecifiers: () => getModuleSpecifiers,
|
|
47325
47330
|
getModuleSpecifiersWithCacheInfo: () => getModuleSpecifiersWithCacheInfo,
|
|
47326
47331
|
getNodeModulesPackageName: () => getNodeModulesPackageName,
|
|
@@ -47331,11 +47336,19 @@ __export(ts_moduleSpecifiers_exports, {
|
|
|
47331
47336
|
});
|
|
47332
47337
|
|
|
47333
47338
|
// src/compiler/moduleSpecifiers.ts
|
|
47334
|
-
|
|
47335
|
-
|
|
47339
|
+
var RelativePreference = /* @__PURE__ */ ((RelativePreference2) => {
|
|
47340
|
+
RelativePreference2[RelativePreference2["Relative"] = 0] = "Relative";
|
|
47341
|
+
RelativePreference2[RelativePreference2["NonRelative"] = 1] = "NonRelative";
|
|
47342
|
+
RelativePreference2[RelativePreference2["Shortest"] = 2] = "Shortest";
|
|
47343
|
+
RelativePreference2[RelativePreference2["ExternalNonRelative"] = 3] = "ExternalNonRelative";
|
|
47344
|
+
return RelativePreference2;
|
|
47345
|
+
})(RelativePreference || {});
|
|
47346
|
+
function getModuleSpecifierPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding }, compilerOptions, importingSourceFile, oldImportSpecifier) {
|
|
47347
|
+
const filePreferredEnding = getPreferredEnding();
|
|
47336
47348
|
return {
|
|
47337
47349
|
relativePreference: oldImportSpecifier !== void 0 ? isExternalModuleNameRelative(oldImportSpecifier) ? 0 /* Relative */ : 1 /* NonRelative */ : importModuleSpecifierPreference === "relative" ? 0 /* Relative */ : importModuleSpecifierPreference === "non-relative" ? 1 /* NonRelative */ : importModuleSpecifierPreference === "project-relative" ? 3 /* ExternalNonRelative */ : 2 /* Shortest */,
|
|
47338
47350
|
getAllowedEndingsInPreferredOrder: (syntaxImpliedNodeFormat) => {
|
|
47351
|
+
const preferredEnding = syntaxImpliedNodeFormat !== importingSourceFile.impliedNodeFormat ? getPreferredEnding(syntaxImpliedNodeFormat) : filePreferredEnding;
|
|
47339
47352
|
if ((syntaxImpliedNodeFormat ?? importingSourceFile.impliedNodeFormat) === 99 /* ESNext */) {
|
|
47340
47353
|
if (shouldAllowImportingTsExtension(compilerOptions, importingSourceFile.fileName)) {
|
|
47341
47354
|
return [3 /* TsExtension */, 2 /* JsExtension */];
|
|
@@ -47360,7 +47373,7 @@ function getPreferences({ importModuleSpecifierPreference, importModuleSpecifier
|
|
|
47360
47373
|
}
|
|
47361
47374
|
}
|
|
47362
47375
|
};
|
|
47363
|
-
function getPreferredEnding() {
|
|
47376
|
+
function getPreferredEnding(resolutionMode) {
|
|
47364
47377
|
if (oldImportSpecifier !== void 0) {
|
|
47365
47378
|
if (hasJSFileExtension(oldImportSpecifier))
|
|
47366
47379
|
return 2 /* JsExtension */;
|
|
@@ -47369,20 +47382,20 @@ function getPreferences({ importModuleSpecifierPreference, importModuleSpecifier
|
|
|
47369
47382
|
}
|
|
47370
47383
|
return getModuleSpecifierEndingPreference(
|
|
47371
47384
|
importModuleSpecifierEnding,
|
|
47372
|
-
importingSourceFile.impliedNodeFormat,
|
|
47385
|
+
resolutionMode ?? importingSourceFile.impliedNodeFormat,
|
|
47373
47386
|
compilerOptions,
|
|
47374
47387
|
importingSourceFile
|
|
47375
47388
|
);
|
|
47376
47389
|
}
|
|
47377
47390
|
}
|
|
47378
47391
|
function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, oldImportSpecifier, options = {}) {
|
|
47379
|
-
const res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host,
|
|
47392
|
+
const res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile, oldImportSpecifier), {}, options);
|
|
47380
47393
|
if (res === oldImportSpecifier)
|
|
47381
47394
|
return void 0;
|
|
47382
47395
|
return res;
|
|
47383
47396
|
}
|
|
47384
47397
|
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, options = {}) {
|
|
47385
|
-
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host,
|
|
47398
|
+
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile), {}, options);
|
|
47386
47399
|
}
|
|
47387
47400
|
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options = {}) {
|
|
47388
47401
|
const info = getInfo(importingSourceFile.fileName, host);
|
|
@@ -47478,7 +47491,7 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
|
|
|
47478
47491
|
}
|
|
47479
47492
|
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
47480
47493
|
const info = getInfo(importingSourceFile.fileName, host);
|
|
47481
|
-
const preferences =
|
|
47494
|
+
const preferences = getModuleSpecifierPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
47482
47495
|
const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
|
|
47483
47496
|
host.getFileIncludeReasons().get(toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)),
|
|
47484
47497
|
(reason) => {
|
|
@@ -47988,7 +48001,7 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
47988
48001
|
if (!parts) {
|
|
47989
48002
|
return void 0;
|
|
47990
48003
|
}
|
|
47991
|
-
const preferences =
|
|
48004
|
+
const preferences = getModuleSpecifierPreferences(userPreferences, options, importingSourceFile);
|
|
47992
48005
|
const allowedEndings = preferences.getAllowedEndingsInPreferredOrder();
|
|
47993
48006
|
let moduleSpecifier = path;
|
|
47994
48007
|
let isPackageRootPath = false;
|
|
@@ -48379,7 +48392,7 @@ function createTypeChecker(host) {
|
|
|
48379
48392
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
48380
48393
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
48381
48394
|
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
48382
|
-
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 :
|
|
48395
|
+
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
|
|
48383
48396
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
48384
48397
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
48385
48398
|
var emitResolver = createResolver();
|
|
@@ -48882,7 +48895,7 @@ function createTypeChecker(host) {
|
|
|
48882
48895
|
var errorTypes = /* @__PURE__ */ new Map();
|
|
48883
48896
|
var seenIntrinsicNames = /* @__PURE__ */ new Set();
|
|
48884
48897
|
var anyType = createIntrinsicType(1 /* Any */, "any");
|
|
48885
|
-
var autoType = createIntrinsicType(1 /* Any */, "any",
|
|
48898
|
+
var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */, "auto");
|
|
48886
48899
|
var wildcardType = createIntrinsicType(
|
|
48887
48900
|
1 /* Any */,
|
|
48888
48901
|
"any",
|
|
@@ -48899,7 +48912,7 @@ function createTypeChecker(host) {
|
|
|
48899
48912
|
);
|
|
48900
48913
|
var errorType = createIntrinsicType(1 /* Any */, "error");
|
|
48901
48914
|
var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
|
|
48902
|
-
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any",
|
|
48915
|
+
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */, "non-inferrable");
|
|
48903
48916
|
var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
|
|
48904
48917
|
var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
48905
48918
|
var nonNullUnknownType = createIntrinsicType(
|
|
@@ -48910,7 +48923,7 @@ function createTypeChecker(host) {
|
|
|
48910
48923
|
"non-null"
|
|
48911
48924
|
);
|
|
48912
48925
|
var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
48913
|
-
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined",
|
|
48926
|
+
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */, "widening");
|
|
48914
48927
|
var missingType = createIntrinsicType(
|
|
48915
48928
|
32768 /* Undefined */,
|
|
48916
48929
|
"undefined",
|
|
@@ -48927,7 +48940,7 @@ function createTypeChecker(host) {
|
|
|
48927
48940
|
"optional"
|
|
48928
48941
|
);
|
|
48929
48942
|
var nullType = createIntrinsicType(65536 /* Null */, "null");
|
|
48930
|
-
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null",
|
|
48943
|
+
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */, "widening");
|
|
48931
48944
|
var stringType = createIntrinsicType(4 /* String */, "string");
|
|
48932
48945
|
var numberType = createIntrinsicType(8 /* Number */, "number");
|
|
48933
48946
|
var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
|
|
@@ -48959,7 +48972,7 @@ function createTypeChecker(host) {
|
|
|
48959
48972
|
var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol");
|
|
48960
48973
|
var voidType = createIntrinsicType(16384 /* Void */, "void");
|
|
48961
48974
|
var neverType = createIntrinsicType(131072 /* Never */, "never");
|
|
48962
|
-
var silentNeverType = createIntrinsicType(131072 /* Never */, "never",
|
|
48975
|
+
var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */, "silent");
|
|
48963
48976
|
var implicitNeverType = createIntrinsicType(
|
|
48964
48977
|
131072 /* Never */,
|
|
48965
48978
|
"never",
|
|
@@ -49026,7 +49039,7 @@ function createTypeChecker(host) {
|
|
|
49026
49039
|
emptyArray,
|
|
49027
49040
|
emptyArray
|
|
49028
49041
|
);
|
|
49029
|
-
emptyJsxObjectType.objectFlags |=
|
|
49042
|
+
emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */;
|
|
49030
49043
|
var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
49031
49044
|
emptyTypeLiteralSymbol.members = createSymbolTable();
|
|
49032
49045
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
@@ -49056,7 +49069,7 @@ function createTypeChecker(host) {
|
|
|
49056
49069
|
emptyArray,
|
|
49057
49070
|
emptyArray
|
|
49058
49071
|
);
|
|
49059
|
-
anyFunctionType.objectFlags |=
|
|
49072
|
+
anyFunctionType.objectFlags |= 262144 /* NonInferrableType */;
|
|
49060
49073
|
var noConstraintType = createAnonymousType(
|
|
49061
49074
|
/*symbol*/
|
|
49062
49075
|
void 0,
|
|
@@ -52294,7 +52307,7 @@ function createTypeChecker(host) {
|
|
|
52294
52307
|
const type = createType(kind);
|
|
52295
52308
|
type.intrinsicName = intrinsicName;
|
|
52296
52309
|
type.debugIntrinsicName = debugIntrinsicName;
|
|
52297
|
-
type.objectFlags = objectFlags |
|
|
52310
|
+
type.objectFlags = objectFlags | 524288 /* CouldContainTypeVariablesComputed */ | 2097152 /* IsGenericTypeComputed */ | 33554432 /* IsUnknownLikeUnionComputed */ | 16777216 /* IsNeverIntersectionComputed */;
|
|
52298
52311
|
return type;
|
|
52299
52312
|
}
|
|
52300
52313
|
function checkIntrinsicName(name, debug) {
|
|
@@ -52883,7 +52896,7 @@ function createTypeChecker(host) {
|
|
|
52883
52896
|
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
52884
52897
|
}
|
|
52885
52898
|
function isClassInstanceSide(type) {
|
|
52886
|
-
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) &
|
|
52899
|
+
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 16777216 /* IsClassInstanceClone */));
|
|
52887
52900
|
}
|
|
52888
52901
|
function createNodeBuilder() {
|
|
52889
52902
|
return {
|
|
@@ -52972,7 +52985,9 @@ function createTypeChecker(host) {
|
|
|
52972
52985
|
context.approximateLength += 3;
|
|
52973
52986
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
52974
52987
|
}
|
|
52975
|
-
|
|
52988
|
+
if (!(context.flags & 536870912 /* NoTypeReduction */)) {
|
|
52989
|
+
type = getReducedType(type);
|
|
52990
|
+
}
|
|
52976
52991
|
if (type.flags & 1 /* Any */) {
|
|
52977
52992
|
if (type.aliasSymbol) {
|
|
52978
52993
|
return factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
|
|
@@ -53344,7 +53359,7 @@ function createTypeChecker(host) {
|
|
|
53344
53359
|
const typeId = type2.id;
|
|
53345
53360
|
const symbol = type2.symbol;
|
|
53346
53361
|
if (symbol) {
|
|
53347
|
-
const isInstantiationExpressionType = !!(getObjectFlags(type2) &
|
|
53362
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
53348
53363
|
if (isInstantiationExpressionType) {
|
|
53349
53364
|
const instantiationExpressionType = type2;
|
|
53350
53365
|
const existing = instantiationExpressionType.node;
|
|
@@ -53682,7 +53697,7 @@ function createTypeChecker(host) {
|
|
|
53682
53697
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
53683
53698
|
}
|
|
53684
53699
|
for (const info of resolvedType.indexInfos) {
|
|
53685
|
-
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags &
|
|
53700
|
+
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
53686
53701
|
}
|
|
53687
53702
|
const properties = resolvedType.properties;
|
|
53688
53703
|
if (!properties) {
|
|
@@ -56926,7 +56941,7 @@ function createTypeChecker(host) {
|
|
|
56926
56941
|
));
|
|
56927
56942
|
}
|
|
56928
56943
|
const result = createAnonymousType(symbol, members, emptyArray, emptyArray, getIndexInfosOfType(source));
|
|
56929
|
-
result.objectFlags |=
|
|
56944
|
+
result.objectFlags |= 4194304 /* ObjectRestType */;
|
|
56930
56945
|
return result;
|
|
56931
56946
|
}
|
|
56932
56947
|
function isGenericTypeWithUndefinedConstraint(type) {
|
|
@@ -57356,7 +57371,7 @@ function createTypeChecker(host) {
|
|
|
57356
57371
|
mergeSymbolTable(exports2, s.exports);
|
|
57357
57372
|
}
|
|
57358
57373
|
const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
|
|
57359
|
-
type.objectFlags |=
|
|
57374
|
+
type.objectFlags |= 4096 /* JSLiteral */;
|
|
57360
57375
|
return type;
|
|
57361
57376
|
}
|
|
57362
57377
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
@@ -57477,9 +57492,9 @@ function createTypeChecker(host) {
|
|
|
57477
57492
|
result.aliasTypeArguments = length(args) ? args : void 0;
|
|
57478
57493
|
}
|
|
57479
57494
|
}
|
|
57480
|
-
result.objectFlags |= getObjectFlags(type) &
|
|
57495
|
+
result.objectFlags |= getObjectFlags(type) & 4096 /* JSLiteral */;
|
|
57481
57496
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
57482
|
-
result.objectFlags |=
|
|
57497
|
+
result.objectFlags |= 16777216 /* IsClassInstanceClone */;
|
|
57483
57498
|
}
|
|
57484
57499
|
return result;
|
|
57485
57500
|
}
|
|
@@ -57532,7 +57547,7 @@ function createTypeChecker(host) {
|
|
|
57532
57547
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) {
|
|
57533
57548
|
const members = createSymbolTable();
|
|
57534
57549
|
let stringIndexInfo;
|
|
57535
|
-
let objectFlags =
|
|
57550
|
+
let objectFlags = 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
57536
57551
|
forEach(pattern.elements, (e) => {
|
|
57537
57552
|
const name = e.propertyName || e.name;
|
|
57538
57553
|
if (e.dotDotDotToken) {
|
|
@@ -57546,7 +57561,7 @@ function createTypeChecker(host) {
|
|
|
57546
57561
|
}
|
|
57547
57562
|
const exprType = getLiteralTypeFromPropertyName(name);
|
|
57548
57563
|
if (!isTypeUsableAsPropertyName(exprType)) {
|
|
57549
|
-
objectFlags |=
|
|
57564
|
+
objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */;
|
|
57550
57565
|
return;
|
|
57551
57566
|
}
|
|
57552
57567
|
const text = getPropertyNameFromType(exprType);
|
|
@@ -57567,7 +57582,7 @@ function createTypeChecker(host) {
|
|
|
57567
57582
|
result.objectFlags |= objectFlags;
|
|
57568
57583
|
if (includePatternInType) {
|
|
57569
57584
|
result.pattern = pattern;
|
|
57570
|
-
result.objectFlags |=
|
|
57585
|
+
result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */;
|
|
57571
57586
|
}
|
|
57572
57587
|
return result;
|
|
57573
57588
|
}
|
|
@@ -57585,7 +57600,7 @@ function createTypeChecker(host) {
|
|
|
57585
57600
|
if (includePatternInType) {
|
|
57586
57601
|
result = cloneTypeReference(result);
|
|
57587
57602
|
result.pattern = pattern;
|
|
57588
|
-
result.objectFlags |=
|
|
57603
|
+
result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */;
|
|
57589
57604
|
}
|
|
57590
57605
|
return result;
|
|
57591
57606
|
}
|
|
@@ -57613,7 +57628,7 @@ function createTypeChecker(host) {
|
|
|
57613
57628
|
members.set(member.escapedName, member);
|
|
57614
57629
|
});
|
|
57615
57630
|
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
57616
|
-
type.objectFlags |=
|
|
57631
|
+
type.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* NonInferrableType */;
|
|
57617
57632
|
links.resolvedType = type;
|
|
57618
57633
|
}
|
|
57619
57634
|
return links.resolvedType;
|
|
@@ -59401,14 +59416,6 @@ function createTypeChecker(host) {
|
|
|
59401
59416
|
type.constructSignatures = constructSignatures;
|
|
59402
59417
|
}
|
|
59403
59418
|
}
|
|
59404
|
-
function resolveTypeAliasInstantiationMembers(type) {
|
|
59405
|
-
const resolved = resolveStructuredTypeMembers(getResolvedTypeAliasInstantiation(type));
|
|
59406
|
-
type.members = resolved.members;
|
|
59407
|
-
type.properties = resolved.properties;
|
|
59408
|
-
type.callSignatures = resolved.callSignatures;
|
|
59409
|
-
type.constructSignatures = resolved.constructSignatures;
|
|
59410
|
-
type.indexInfos = resolved.indexInfos;
|
|
59411
|
-
}
|
|
59412
59419
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
59413
59420
|
return instantiateType(instantiable, createTypeMapper([type.indexType, type.objectType], [getNumberLiteralType(0), createTupleType([replacement])]));
|
|
59414
59421
|
}
|
|
@@ -59675,14 +59682,12 @@ function createTypeChecker(host) {
|
|
|
59675
59682
|
resolveTypeReferenceMembers(type);
|
|
59676
59683
|
} else if (type.objectFlags & 3 /* ClassOrInterface */) {
|
|
59677
59684
|
resolveClassOrInterfaceMembers(type);
|
|
59678
|
-
} else if (type.objectFlags &
|
|
59685
|
+
} else if (type.objectFlags & 1024 /* ReverseMapped */) {
|
|
59679
59686
|
resolveReverseMappedTypeMembers(type);
|
|
59680
59687
|
} else if (type.objectFlags & 16 /* Anonymous */) {
|
|
59681
59688
|
resolveAnonymousTypeMembers(type);
|
|
59682
59689
|
} else if (type.objectFlags & 32 /* Mapped */) {
|
|
59683
59690
|
resolveMappedTypeMembers(type);
|
|
59684
|
-
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
59685
|
-
resolveTypeAliasInstantiationMembers(type);
|
|
59686
59691
|
} else {
|
|
59687
59692
|
Debug.fail("Unhandled object type " + Debug.formatObjectFlags(type.objectFlags));
|
|
59688
59693
|
}
|
|
@@ -60128,7 +60133,7 @@ function createTypeChecker(host) {
|
|
|
60128
60133
|
if (indexInfo) {
|
|
60129
60134
|
checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
|
|
60130
60135
|
indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
|
|
60131
|
-
} else if (isObjectLiteralType2(type) && !(getObjectFlags(type) &
|
|
60136
|
+
} else if (isObjectLiteralType2(type) && !(getObjectFlags(type) & 2097152 /* ContainsSpread */)) {
|
|
60132
60137
|
checkFlags |= 32 /* WritePartial */;
|
|
60133
60138
|
indexTypes = append(indexTypes, undefinedType);
|
|
60134
60139
|
} else {
|
|
@@ -60254,22 +60259,22 @@ function createTypeChecker(host) {
|
|
|
60254
60259
|
return property && !(getCheckFlags(property) & 16 /* ReadPartial */) ? property : void 0;
|
|
60255
60260
|
}
|
|
60256
60261
|
function getReducedType(type) {
|
|
60257
|
-
if (type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
60262
|
+
if (type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */) {
|
|
60258
60263
|
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
|
60259
60264
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
60260
|
-
if (!(type.objectFlags &
|
|
60261
|
-
type.objectFlags |=
|
|
60265
|
+
if (!(type.objectFlags & 16777216 /* IsNeverIntersectionComputed */)) {
|
|
60266
|
+
type.objectFlags |= 16777216 /* IsNeverIntersectionComputed */ | (some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 33554432 /* IsNeverIntersection */ : 0);
|
|
60262
60267
|
}
|
|
60263
|
-
return type.objectFlags &
|
|
60268
|
+
return type.objectFlags & 33554432 /* IsNeverIntersection */ ? neverType : type;
|
|
60264
60269
|
}
|
|
60265
|
-
return
|
|
60270
|
+
return type;
|
|
60266
60271
|
}
|
|
60267
60272
|
function getReducedUnionType(unionType) {
|
|
60268
60273
|
const reducedTypes = sameMap(unionType.types, getReducedType);
|
|
60269
60274
|
if (reducedTypes === unionType.types) {
|
|
60270
60275
|
return unionType;
|
|
60271
60276
|
}
|
|
60272
|
-
const reduced =
|
|
60277
|
+
const reduced = getUnionType(reducedTypes);
|
|
60273
60278
|
if (reduced.flags & 1048576 /* Union */) {
|
|
60274
60279
|
reduced.resolvedReducedType = reduced;
|
|
60275
60280
|
}
|
|
@@ -60285,14 +60290,14 @@ function createTypeChecker(host) {
|
|
|
60285
60290
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
60286
60291
|
}
|
|
60287
60292
|
function isGenericReducibleType(type) {
|
|
60288
|
-
return !!(type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
60293
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
60289
60294
|
}
|
|
60290
60295
|
function isReducibleIntersection(type) {
|
|
60291
60296
|
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
60292
60297
|
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
60293
60298
|
}
|
|
60294
60299
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
60295
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
60300
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
|
|
60296
60301
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
60297
60302
|
if (neverProp) {
|
|
60298
60303
|
return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(
|
|
@@ -61078,7 +61083,7 @@ function createTypeChecker(host) {
|
|
|
61078
61083
|
result |= getObjectFlags(type);
|
|
61079
61084
|
}
|
|
61080
61085
|
}
|
|
61081
|
-
return result &
|
|
61086
|
+
return result & 458752 /* PropagatingFlags */;
|
|
61082
61087
|
}
|
|
61083
61088
|
function tryCreateTypeReference(target, typeArguments) {
|
|
61084
61089
|
if (some(typeArguments) && target === emptyGenericType) {
|
|
@@ -61165,7 +61170,7 @@ function createTypeChecker(host) {
|
|
|
61165
61170
|
return errorType;
|
|
61166
61171
|
}
|
|
61167
61172
|
}
|
|
61168
|
-
if (node.kind === 183 /* TypeReference */ &&
|
|
61173
|
+
if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
61169
61174
|
return createDeferredTypeReference(
|
|
61170
61175
|
type,
|
|
61171
61176
|
node,
|
|
@@ -61178,6 +61183,23 @@ function createTypeChecker(host) {
|
|
|
61178
61183
|
}
|
|
61179
61184
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
61180
61185
|
}
|
|
61186
|
+
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
61187
|
+
const type = getDeclaredTypeOfSymbol(symbol);
|
|
61188
|
+
if (type === intrinsicMarkerType) {
|
|
61189
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
61190
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
61191
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
61192
|
+
}
|
|
61193
|
+
}
|
|
61194
|
+
const links = getSymbolLinks(symbol);
|
|
61195
|
+
const typeParameters = links.typeParameters;
|
|
61196
|
+
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
61197
|
+
let instantiation = links.instantiations.get(id);
|
|
61198
|
+
if (!instantiation) {
|
|
61199
|
+
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
61200
|
+
}
|
|
61201
|
+
return instantiation;
|
|
61202
|
+
}
|
|
61181
61203
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
61182
61204
|
if (getCheckFlags(symbol) & 1048576 /* Unresolved */) {
|
|
61183
61205
|
const typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
@@ -61228,13 +61250,10 @@ function createTypeChecker(host) {
|
|
|
61228
61250
|
const resolved = resolveAlias(aliasSymbol2);
|
|
61229
61251
|
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
61230
61252
|
newAliasSymbol = resolved;
|
|
61231
|
-
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node)
|
|
61253
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) || (typeParameters ? [] : void 0);
|
|
61232
61254
|
}
|
|
61233
61255
|
}
|
|
61234
61256
|
}
|
|
61235
|
-
if (getObjectFlags(type) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */) && node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
61236
|
-
return createDeferredTypeAliasInstantiation(symbol, node, newAliasSymbol, aliasTypeArguments);
|
|
61237
|
-
}
|
|
61238
61257
|
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
|
|
61239
61258
|
}
|
|
61240
61259
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
@@ -61244,43 +61263,6 @@ function createTypeChecker(host) {
|
|
|
61244
61263
|
const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias);
|
|
61245
61264
|
return !!(declaration && getContainingFunction(declaration));
|
|
61246
61265
|
}
|
|
61247
|
-
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
61248
|
-
const type = getDeclaredTypeOfSymbol(symbol);
|
|
61249
|
-
if (type === intrinsicMarkerType) {
|
|
61250
|
-
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
61251
|
-
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
61252
|
-
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
61253
|
-
}
|
|
61254
|
-
}
|
|
61255
|
-
const links = getSymbolLinks(symbol);
|
|
61256
|
-
const typeParameters = links.typeParameters;
|
|
61257
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
61258
|
-
let instantiation = links.instantiations.get(id);
|
|
61259
|
-
if (!instantiation) {
|
|
61260
|
-
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
61261
|
-
}
|
|
61262
|
-
return instantiation;
|
|
61263
|
-
}
|
|
61264
|
-
function createDeferredTypeAliasInstantiation(typeAlias, node, aliasSymbol, aliasTypeArguments) {
|
|
61265
|
-
const type = getDeclaredTypeOfSymbol(typeAlias);
|
|
61266
|
-
const result = createObjectType(64 /* TypeAliasInstantiation */, type.symbol);
|
|
61267
|
-
result.typeAlias = typeAlias;
|
|
61268
|
-
result.node = node;
|
|
61269
|
-
result.aliasSymbol = aliasSymbol;
|
|
61270
|
-
result.aliasTypeArguments = aliasTypeArguments;
|
|
61271
|
-
return result;
|
|
61272
|
-
}
|
|
61273
|
-
function getResolvedType(type) {
|
|
61274
|
-
return type.flags & 524288 /* Object */ && type.objectFlags & 64 /* TypeAliasInstantiation */ ? getResolvedTypeAliasInstantiation(type) : type;
|
|
61275
|
-
}
|
|
61276
|
-
function getResolvedTypeAliasInstantiation(type) {
|
|
61277
|
-
if (!type.resolvedType) {
|
|
61278
|
-
const typeArguments = typeArgumentsFromTypeReferenceNode(type.node);
|
|
61279
|
-
const mappedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
|
|
61280
|
-
type.resolvedType = getTypeAliasInstantiation(type.typeAlias, mappedTypeArguments, type.aliasSymbol, type.aliasTypeArguments);
|
|
61281
|
-
}
|
|
61282
|
-
return type.resolvedType;
|
|
61283
|
-
}
|
|
61284
61266
|
function getTypeReferenceName(node) {
|
|
61285
61267
|
switch (node.kind) {
|
|
61286
61268
|
case 183 /* TypeReference */:
|
|
@@ -61972,7 +61954,7 @@ function createTypeChecker(host) {
|
|
|
61972
61954
|
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
61973
61955
|
}
|
|
61974
61956
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
61975
|
-
return isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
61957
|
+
return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
61976
61958
|
}
|
|
61977
61959
|
function isResolvedByTypeAlias(node) {
|
|
61978
61960
|
const parent2 = node.parent;
|
|
@@ -62027,7 +62009,7 @@ function createTypeChecker(host) {
|
|
|
62027
62009
|
const target = getArrayOrTupleTargetType(node);
|
|
62028
62010
|
if (target === emptyGenericType) {
|
|
62029
62011
|
links.resolvedType = emptyObjectType;
|
|
62030
|
-
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) &&
|
|
62012
|
+
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
|
|
62031
62013
|
links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(
|
|
62032
62014
|
target,
|
|
62033
62015
|
node,
|
|
@@ -62247,12 +62229,12 @@ function createTypeChecker(host) {
|
|
|
62247
62229
|
includes |= flags & 473694207 /* IncludesMask */;
|
|
62248
62230
|
if (flags & 465829888 /* Instantiable */)
|
|
62249
62231
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
62250
|
-
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62232
|
+
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
|
|
62251
62233
|
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
62252
62234
|
if (type === wildcardType)
|
|
62253
62235
|
includes |= 8388608 /* IncludesWildcard */;
|
|
62254
62236
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
62255
|
-
if (!(getObjectFlags(type) &
|
|
62237
|
+
if (!(getObjectFlags(type) & 65536 /* ContainsWideningType */))
|
|
62256
62238
|
includes |= 4194304 /* IncludesNonWideningType */;
|
|
62257
62239
|
} else {
|
|
62258
62240
|
const len = typeSet.length;
|
|
@@ -62359,7 +62341,7 @@ function createTypeChecker(host) {
|
|
|
62359
62341
|
function removeConstrainedTypeVariables(types) {
|
|
62360
62342
|
const typeVariables = [];
|
|
62361
62343
|
for (const type of types) {
|
|
62362
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62344
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
62363
62345
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
62364
62346
|
pushIfUnique(typeVariables, type.types[index]);
|
|
62365
62347
|
}
|
|
@@ -62367,7 +62349,7 @@ function createTypeChecker(host) {
|
|
|
62367
62349
|
for (const typeVariable of typeVariables) {
|
|
62368
62350
|
const primitives = [];
|
|
62369
62351
|
for (const type of types) {
|
|
62370
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62352
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
62371
62353
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
62372
62354
|
if (type.types[index] === typeVariable) {
|
|
62373
62355
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -62380,7 +62362,7 @@ function createTypeChecker(host) {
|
|
|
62380
62362
|
while (i > 0) {
|
|
62381
62363
|
i--;
|
|
62382
62364
|
const type = types[i];
|
|
62383
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62365
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
62384
62366
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
62385
62367
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
62386
62368
|
orderedRemoveItemAt(types, i);
|
|
@@ -62489,7 +62471,7 @@ function createTypeChecker(host) {
|
|
|
62489
62471
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
62490
62472
|
}
|
|
62491
62473
|
}
|
|
62492
|
-
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 :
|
|
62474
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
|
|
62493
62475
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
62494
62476
|
}
|
|
62495
62477
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -62640,14 +62622,14 @@ function createTypeChecker(host) {
|
|
|
62640
62622
|
}
|
|
62641
62623
|
function intersectUnionsOfPrimitiveTypes(types) {
|
|
62642
62624
|
let unionTypes2;
|
|
62643
|
-
const index = findIndex(types, (t) => !!(getObjectFlags(t) &
|
|
62625
|
+
const index = findIndex(types, (t) => !!(getObjectFlags(t) & 32768 /* PrimitiveUnion */));
|
|
62644
62626
|
if (index < 0) {
|
|
62645
62627
|
return false;
|
|
62646
62628
|
}
|
|
62647
62629
|
let i = index + 1;
|
|
62648
62630
|
while (i < types.length) {
|
|
62649
62631
|
const t = types[i];
|
|
62650
|
-
if (getObjectFlags(t) &
|
|
62632
|
+
if (getObjectFlags(t) & 32768 /* PrimitiveUnion */) {
|
|
62651
62633
|
(unionTypes2 || (unionTypes2 = [types[index]])).push(t);
|
|
62652
62634
|
orderedRemoveItemAt(types, i);
|
|
62653
62635
|
} else {
|
|
@@ -62668,7 +62650,7 @@ function createTypeChecker(host) {
|
|
|
62668
62650
|
}
|
|
62669
62651
|
}
|
|
62670
62652
|
}
|
|
62671
|
-
types[index] = getUnionTypeFromSortedList(result,
|
|
62653
|
+
types[index] = getUnionTypeFromSortedList(result, 32768 /* PrimitiveUnion */);
|
|
62672
62654
|
return true;
|
|
62673
62655
|
}
|
|
62674
62656
|
function createIntersectionType(types, objectFlags, aliasSymbol, aliasTypeArguments) {
|
|
@@ -62731,7 +62713,7 @@ function createTypeChecker(host) {
|
|
|
62731
62713
|
return neverType;
|
|
62732
62714
|
}
|
|
62733
62715
|
}
|
|
62734
|
-
objectFlags =
|
|
62716
|
+
objectFlags = 67108864 /* IsConstrainedTypeVariable */;
|
|
62735
62717
|
}
|
|
62736
62718
|
}
|
|
62737
62719
|
}
|
|
@@ -63084,7 +63066,7 @@ function createTypeChecker(host) {
|
|
|
63084
63066
|
if (noImplicitAny) {
|
|
63085
63067
|
return false;
|
|
63086
63068
|
}
|
|
63087
|
-
if (getObjectFlags(type) &
|
|
63069
|
+
if (getObjectFlags(type) & 4096 /* JSLiteral */) {
|
|
63088
63070
|
return true;
|
|
63089
63071
|
}
|
|
63090
63072
|
if (type.flags & 1048576 /* Union */) {
|
|
@@ -63332,28 +63314,28 @@ function createTypeChecker(host) {
|
|
|
63332
63314
|
return !!getGenericObjectFlags(type);
|
|
63333
63315
|
}
|
|
63334
63316
|
function isGenericObjectType(type) {
|
|
63335
|
-
return !!(getGenericObjectFlags(type) &
|
|
63317
|
+
return !!(getGenericObjectFlags(type) & 4194304 /* IsGenericObjectType */);
|
|
63336
63318
|
}
|
|
63337
63319
|
function isGenericIndexType(type) {
|
|
63338
|
-
return !!(getGenericObjectFlags(type) &
|
|
63320
|
+
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
63339
63321
|
}
|
|
63340
63322
|
function getGenericObjectFlags(type) {
|
|
63341
63323
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
63342
|
-
if (!(type.objectFlags &
|
|
63343
|
-
type.objectFlags |=
|
|
63324
|
+
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
63325
|
+
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
63344
63326
|
}
|
|
63345
|
-
return type.objectFlags &
|
|
63327
|
+
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
63346
63328
|
}
|
|
63347
63329
|
if (type.flags & 33554432 /* Substitution */) {
|
|
63348
|
-
if (!(type.objectFlags &
|
|
63349
|
-
type.objectFlags |=
|
|
63330
|
+
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
63331
|
+
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | getGenericObjectFlags(type.baseType) | getGenericObjectFlags(type.constraint);
|
|
63350
63332
|
}
|
|
63351
|
-
return type.objectFlags &
|
|
63333
|
+
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
63352
63334
|
}
|
|
63353
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(
|
|
63335
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
63354
63336
|
}
|
|
63355
63337
|
function getSimplifiedType(type, writing) {
|
|
63356
|
-
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) :
|
|
63338
|
+
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
63357
63339
|
}
|
|
63358
63340
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
63359
63341
|
if (objectType.flags & 1048576 /* Union */ || objectType.flags & 2097152 /* Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
@@ -63853,7 +63835,7 @@ function createTypeChecker(host) {
|
|
|
63853
63835
|
}
|
|
63854
63836
|
}
|
|
63855
63837
|
const spread = createAnonymousType(type2.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type2));
|
|
63856
|
-
spread.objectFlags |=
|
|
63838
|
+
spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
63857
63839
|
return spread;
|
|
63858
63840
|
}
|
|
63859
63841
|
}
|
|
@@ -63930,7 +63912,7 @@ function createTypeChecker(host) {
|
|
|
63930
63912
|
}
|
|
63931
63913
|
}
|
|
63932
63914
|
const spread = createAnonymousType(symbol, members, emptyArray, emptyArray, sameMap(indexInfos, (info) => getIndexInfoWithReadonly(info, readonly)));
|
|
63933
|
-
spread.objectFlags |=
|
|
63915
|
+
spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */ | 2097152 /* ContainsSpread */ | objectFlags;
|
|
63934
63916
|
return spread;
|
|
63935
63917
|
}
|
|
63936
63918
|
function isSpreadableProperty(prop) {
|
|
@@ -64351,9 +64333,9 @@ function createTypeChecker(host) {
|
|
|
64351
64333
|
return result;
|
|
64352
64334
|
}
|
|
64353
64335
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
64354
|
-
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags &
|
|
64336
|
+
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0];
|
|
64355
64337
|
const links = getNodeLinks(declaration);
|
|
64356
|
-
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags &
|
|
64338
|
+
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
64357
64339
|
let typeParameters = links.outerTypeParameters;
|
|
64358
64340
|
if (!typeParameters) {
|
|
64359
64341
|
let outerTypeParameters = getOuterTypeParameters(
|
|
@@ -64366,8 +64348,8 @@ function createTypeChecker(host) {
|
|
|
64366
64348
|
outerTypeParameters = addRange(outerTypeParameters, templateTagParameters);
|
|
64367
64349
|
}
|
|
64368
64350
|
typeParameters = outerTypeParameters || emptyArray;
|
|
64369
|
-
const allDeclarations = type.objectFlags & (4 /* Reference */ |
|
|
64370
|
-
typeParameters = (target.objectFlags & (4 /* Reference */ |
|
|
64351
|
+
const allDeclarations = type.objectFlags & (4 /* Reference */ | 8388608 /* InstantiationExpressionType */) ? [declaration] : type.symbol.declarations;
|
|
64352
|
+
typeParameters = (target.objectFlags & (4 /* Reference */ | 8388608 /* InstantiationExpressionType */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ? filter(typeParameters, (tp) => some(allDeclarations, (d) => isTypeParameterPossiblyReferenced(tp, d))) : typeParameters;
|
|
64371
64353
|
links.outerTypeParameters = typeParameters;
|
|
64372
64354
|
}
|
|
64373
64355
|
if (typeParameters.length) {
|
|
@@ -64386,13 +64368,13 @@ function createTypeChecker(host) {
|
|
|
64386
64368
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
64387
64369
|
target.instantiations.set(id, result);
|
|
64388
64370
|
const resultObjectFlags = getObjectFlags(result);
|
|
64389
|
-
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags &
|
|
64371
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
64390
64372
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
64391
|
-
if (!(getObjectFlags(result) &
|
|
64373
|
+
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
64392
64374
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
64393
|
-
result.objectFlags |=
|
|
64375
|
+
result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
64394
64376
|
} else {
|
|
64395
|
-
result.objectFlags |= !resultCouldContainTypeVariables ?
|
|
64377
|
+
result.objectFlags |= !resultCouldContainTypeVariables ? 524288 /* CouldContainTypeVariablesComputed */ : 0;
|
|
64396
64378
|
}
|
|
64397
64379
|
}
|
|
64398
64380
|
}
|
|
@@ -64522,7 +64504,8 @@ function createTypeChecker(host) {
|
|
|
64522
64504
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
64523
64505
|
}
|
|
64524
64506
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
64525
|
-
|
|
64507
|
+
Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
|
|
64508
|
+
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
64526
64509
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
64527
64510
|
result.declaration = type.declaration;
|
|
64528
64511
|
const origTypeParameter = getTypeParameterFromMappedType(type);
|
|
@@ -64530,10 +64513,8 @@ function createTypeChecker(host) {
|
|
|
64530
64513
|
result.typeParameter = freshTypeParameter;
|
|
64531
64514
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
64532
64515
|
freshTypeParameter.mapper = mapper;
|
|
64533
|
-
}
|
|
64534
|
-
|
|
64535
|
-
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
64536
|
-
result.typeAlias = type.typeAlias;
|
|
64516
|
+
}
|
|
64517
|
+
if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
|
|
64537
64518
|
result.node = type.node;
|
|
64538
64519
|
}
|
|
64539
64520
|
result.target = type;
|
|
@@ -64552,8 +64533,8 @@ function createTypeChecker(host) {
|
|
|
64552
64533
|
if (!result) {
|
|
64553
64534
|
const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
|
|
64554
64535
|
const checkType = root.checkType;
|
|
64555
|
-
const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
|
|
64556
|
-
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(
|
|
64536
|
+
const distributionType = root.isDistributive ? getReducedType(getMappedType(checkType, newMapper)) : void 0;
|
|
64537
|
+
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(distributionType, (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
|
|
64557
64538
|
root.instantiations.set(id, result);
|
|
64558
64539
|
}
|
|
64559
64540
|
return result;
|
|
@@ -64594,13 +64575,13 @@ function createTypeChecker(host) {
|
|
|
64594
64575
|
}
|
|
64595
64576
|
if (flags & 524288 /* Object */) {
|
|
64596
64577
|
const objectFlags = type.objectFlags;
|
|
64597
|
-
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */
|
|
64578
|
+
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */)) {
|
|
64598
64579
|
if (objectFlags & 4 /* Reference */ && !type.node) {
|
|
64599
64580
|
const resolvedTypeArguments = type.resolvedTypeArguments;
|
|
64600
64581
|
const newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper);
|
|
64601
64582
|
return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type;
|
|
64602
64583
|
}
|
|
64603
|
-
if (objectFlags &
|
|
64584
|
+
if (objectFlags & 1024 /* ReverseMapped */) {
|
|
64604
64585
|
return instantiateReverseMappedType(type, mapper);
|
|
64605
64586
|
}
|
|
64606
64587
|
return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments);
|
|
@@ -65536,11 +65517,11 @@ function createTypeChecker(host) {
|
|
|
65536
65517
|
}
|
|
65537
65518
|
function isUnknownLikeUnionType(type) {
|
|
65538
65519
|
if (strictNullChecks && type.flags & 1048576 /* Union */) {
|
|
65539
|
-
if (!(type.objectFlags &
|
|
65520
|
+
if (!(type.objectFlags & 33554432 /* IsUnknownLikeUnionComputed */)) {
|
|
65540
65521
|
const types = type.types;
|
|
65541
|
-
type.objectFlags |=
|
|
65522
|
+
type.objectFlags |= 33554432 /* IsUnknownLikeUnionComputed */ | (types.length >= 3 && types[0].flags & 32768 /* Undefined */ && types[1].flags & 65536 /* Null */ && some(types, isEmptyAnonymousObjectType) ? 67108864 /* IsUnknownLikeUnion */ : 0);
|
|
65542
65523
|
}
|
|
65543
|
-
return !!(type.objectFlags &
|
|
65524
|
+
return !!(type.objectFlags & 67108864 /* IsUnknownLikeUnion */);
|
|
65544
65525
|
}
|
|
65545
65526
|
return false;
|
|
65546
65527
|
}
|
|
@@ -65651,7 +65632,7 @@ function createTypeChecker(host) {
|
|
|
65651
65632
|
return true;
|
|
65652
65633
|
if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */))
|
|
65653
65634
|
return true;
|
|
65654
|
-
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) &
|
|
65635
|
+
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) & 8192 /* FreshLiteral */)))
|
|
65655
65636
|
return true;
|
|
65656
65637
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
65657
65638
|
if (s & 1 /* Any */)
|
|
@@ -65710,11 +65691,11 @@ function createTypeChecker(host) {
|
|
|
65710
65691
|
return false;
|
|
65711
65692
|
}
|
|
65712
65693
|
function isIgnoredJsxProperty(source, sourceProp) {
|
|
65713
|
-
return getObjectFlags(source) &
|
|
65694
|
+
return getObjectFlags(source) & 2048 /* JsxAttributes */ && isHyphenatedJsxName(sourceProp.escapedName);
|
|
65714
65695
|
}
|
|
65715
65696
|
function getNormalizedType(type, writing) {
|
|
65716
65697
|
while (true) {
|
|
65717
|
-
const t = isFreshLiteralType(type) ? type.regularType : isGenericTupleType(type) ? getNormalizedTupleType(type, writing) : getObjectFlags(type) & 4 /* Reference */ ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type :
|
|
65698
|
+
const t = isFreshLiteralType(type) ? type.regularType : isGenericTupleType(type) ? getNormalizedTupleType(type, writing) : getObjectFlags(type) & 4 /* Reference */ ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type : type.flags & 3145728 /* UnionOrIntersection */ ? getNormalizedUnionOrIntersectionType(type, writing) : type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : getSubstitutionIntersection(type) : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type;
|
|
65718
65699
|
if (t === type)
|
|
65719
65700
|
return t;
|
|
65720
65701
|
type = t;
|
|
@@ -66104,7 +66085,7 @@ function createTypeChecker(host) {
|
|
|
66104
66085
|
if (relation === comparableRelation && !(target2.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0))
|
|
66105
66086
|
return -1 /* True */;
|
|
66106
66087
|
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
66107
|
-
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) &
|
|
66088
|
+
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */);
|
|
66108
66089
|
if (isPerformingExcessPropertyChecks) {
|
|
66109
66090
|
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
66110
66091
|
if (reportErrors2) {
|
|
@@ -66114,7 +66095,7 @@ function createTypeChecker(host) {
|
|
|
66114
66095
|
}
|
|
66115
66096
|
}
|
|
66116
66097
|
const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (402784252 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2));
|
|
66117
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
66098
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */);
|
|
66118
66099
|
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) {
|
|
66119
66100
|
if (reportErrors2) {
|
|
66120
66101
|
const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2);
|
|
@@ -66179,7 +66160,7 @@ function createTypeChecker(host) {
|
|
|
66179
66160
|
tryElaborateErrorsForPrimitivesAndObjects(source2, target2);
|
|
66180
66161
|
} else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) {
|
|
66181
66162
|
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
66182
|
-
} else if (getObjectFlags(source2) &
|
|
66163
|
+
} else if (getObjectFlags(source2) & 2048 /* JsxAttributes */ && target2.flags & 2097152 /* Intersection */) {
|
|
66183
66164
|
const targetTypes = target2.types;
|
|
66184
66165
|
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
66185
66166
|
const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
@@ -66210,7 +66191,7 @@ function createTypeChecker(host) {
|
|
|
66210
66191
|
if (source2.flags & 3145728 /* UnionOrIntersection */ && target2.flags & 3145728 /* UnionOrIntersection */) {
|
|
66211
66192
|
const sourceUnionOrIntersection = source2;
|
|
66212
66193
|
const targetUnionOrIntersection = target2;
|
|
66213
|
-
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags &
|
|
66194
|
+
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 32768 /* PrimitiveUnion */) {
|
|
66214
66195
|
return;
|
|
66215
66196
|
}
|
|
66216
66197
|
const sourceSize = sourceUnionOrIntersection.types.length;
|
|
@@ -66244,10 +66225,10 @@ function createTypeChecker(host) {
|
|
|
66244
66225
|
}
|
|
66245
66226
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
66246
66227
|
var _a2;
|
|
66247
|
-
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) &
|
|
66228
|
+
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 4096 /* JSLiteral */) {
|
|
66248
66229
|
return false;
|
|
66249
66230
|
}
|
|
66250
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
66231
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */);
|
|
66251
66232
|
if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) {
|
|
66252
66233
|
return false;
|
|
66253
66234
|
}
|
|
@@ -66386,7 +66367,7 @@ function createTypeChecker(host) {
|
|
|
66386
66367
|
if (containsType(targetTypes, source2)) {
|
|
66387
66368
|
return -1 /* True */;
|
|
66388
66369
|
}
|
|
66389
|
-
if (relation !== comparableRelation && getObjectFlags(target2) &
|
|
66370
|
+
if (relation !== comparableRelation && getObjectFlags(target2) & 32768 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
|
|
66390
66371
|
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
66391
66372
|
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
66392
66373
|
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
@@ -66790,7 +66771,7 @@ function createTypeChecker(host) {
|
|
|
66790
66771
|
false,
|
|
66791
66772
|
0 /* None */
|
|
66792
66773
|
);
|
|
66793
|
-
if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) &
|
|
66774
|
+
if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */) {
|
|
66794
66775
|
result2 &= indexSignaturesRelatedTo(
|
|
66795
66776
|
source2,
|
|
66796
66777
|
target2,
|
|
@@ -66800,7 +66781,7 @@ function createTypeChecker(host) {
|
|
|
66800
66781
|
0 /* None */
|
|
66801
66782
|
);
|
|
66802
66783
|
}
|
|
66803
|
-
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) &
|
|
66784
|
+
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) {
|
|
66804
66785
|
result2 &= propertiesRelatedTo(
|
|
66805
66786
|
source2,
|
|
66806
66787
|
target2,
|
|
@@ -67301,7 +67282,7 @@ function createTypeChecker(host) {
|
|
|
67301
67282
|
if (constraint !== source2) {
|
|
67302
67283
|
return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2);
|
|
67303
67284
|
}
|
|
67304
|
-
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) &
|
|
67285
|
+
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 8192 /* FreshLiteral */ && !isEmptyObjectType(source2)) {
|
|
67305
67286
|
return 0 /* False */;
|
|
67306
67287
|
}
|
|
67307
67288
|
if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
|
|
@@ -67833,7 +67814,7 @@ function createTypeChecker(host) {
|
|
|
67833
67814
|
const incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
67834
67815
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
67835
67816
|
const targetObjectFlags = getObjectFlags(target2);
|
|
67836
|
-
if (sourceObjectFlags &
|
|
67817
|
+
if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
67837
67818
|
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
67838
67819
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
67839
67820
|
const related = signatureRelatedTo(
|
|
@@ -68049,7 +68030,7 @@ function createTypeChecker(host) {
|
|
|
68049
68030
|
if (sourceInfo) {
|
|
68050
68031
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
68051
68032
|
}
|
|
68052
|
-
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) &
|
|
68033
|
+
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 8192 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) {
|
|
68053
68034
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
68054
68035
|
}
|
|
68055
68036
|
if (reportErrors2) {
|
|
@@ -68323,11 +68304,11 @@ function createTypeChecker(host) {
|
|
|
68323
68304
|
}
|
|
68324
68305
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
68325
68306
|
if (depth >= maxDepth) {
|
|
68326
|
-
if ((getObjectFlags(type) &
|
|
68307
|
+
if ((getObjectFlags(type) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */) {
|
|
68327
68308
|
type = getMappedTargetWithSymbol(type);
|
|
68328
68309
|
}
|
|
68329
68310
|
if (type.flags & 2097152 /* Intersection */) {
|
|
68330
|
-
return some(type.types, (t) => isDeeplyNestedType(
|
|
68311
|
+
return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth));
|
|
68331
68312
|
}
|
|
68332
68313
|
const identity2 = getRecursionIdentity(type);
|
|
68333
68314
|
let count = 0;
|
|
@@ -68349,17 +68330,17 @@ function createTypeChecker(host) {
|
|
|
68349
68330
|
}
|
|
68350
68331
|
function getMappedTargetWithSymbol(type) {
|
|
68351
68332
|
let target;
|
|
68352
|
-
while ((getObjectFlags(type) &
|
|
68333
|
+
while ((getObjectFlags(type) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */ && (target = getModifiersTypeFromMappedType(type)) && (target.symbol || target.flags & 2097152 /* Intersection */ && some(target.types, (t) => !!t.symbol))) {
|
|
68353
68334
|
type = target;
|
|
68354
68335
|
}
|
|
68355
68336
|
return type;
|
|
68356
68337
|
}
|
|
68357
68338
|
function hasMatchingRecursionIdentity(type, identity2) {
|
|
68358
|
-
if ((getObjectFlags(type) &
|
|
68339
|
+
if ((getObjectFlags(type) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */) {
|
|
68359
68340
|
type = getMappedTargetWithSymbol(type);
|
|
68360
68341
|
}
|
|
68361
68342
|
if (type.flags & 2097152 /* Intersection */) {
|
|
68362
|
-
return some(type.types, (t) => hasMatchingRecursionIdentity(
|
|
68343
|
+
return some(type.types, (t) => hasMatchingRecursionIdentity(t, identity2));
|
|
68363
68344
|
}
|
|
68364
68345
|
return getRecursionIdentity(type) === identity2;
|
|
68365
68346
|
}
|
|
@@ -68542,10 +68523,10 @@ function createTypeChecker(host) {
|
|
|
68542
68523
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
68543
68524
|
return void 0;
|
|
68544
68525
|
}
|
|
68545
|
-
if (getObjectFlags(type) &
|
|
68546
|
-
return getObjectFlags(type) &
|
|
68526
|
+
if (getObjectFlags(type) & 33554432 /* IdenticalBaseTypeCalculated */) {
|
|
68527
|
+
return getObjectFlags(type) & 67108864 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : void 0;
|
|
68547
68528
|
}
|
|
68548
|
-
type.objectFlags |=
|
|
68529
|
+
type.objectFlags |= 33554432 /* IdenticalBaseTypeCalculated */;
|
|
68549
68530
|
const target = type.target;
|
|
68550
68531
|
if (getObjectFlags(target) & 1 /* Class */) {
|
|
68551
68532
|
const baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -68564,7 +68545,7 @@ function createTypeChecker(host) {
|
|
|
68564
68545
|
if (length(getTypeArguments(type)) > length(target.typeParameters)) {
|
|
68565
68546
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, last(getTypeArguments(type)));
|
|
68566
68547
|
}
|
|
68567
|
-
type.objectFlags |=
|
|
68548
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeExists */;
|
|
68568
68549
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
68569
68550
|
}
|
|
68570
68551
|
function isEmptyLiteralType(type) {
|
|
@@ -68749,7 +68730,7 @@ function createTypeChecker(host) {
|
|
|
68749
68730
|
}
|
|
68750
68731
|
function isObjectTypeWithInferableIndex(type) {
|
|
68751
68732
|
const objectFlags = getObjectFlags(type);
|
|
68752
|
-
return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags &
|
|
68733
|
+
return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source));
|
|
68753
68734
|
}
|
|
68754
68735
|
function createSymbolWithType(source, type) {
|
|
68755
68736
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
@@ -68776,7 +68757,7 @@ function createTypeChecker(host) {
|
|
|
68776
68757
|
return members;
|
|
68777
68758
|
}
|
|
68778
68759
|
function getRegularTypeOfObjectLiteral(type) {
|
|
68779
|
-
if (!(isObjectLiteralType2(type) && getObjectFlags(type) &
|
|
68760
|
+
if (!(isObjectLiteralType2(type) && getObjectFlags(type) & 8192 /* FreshLiteral */)) {
|
|
68780
68761
|
return type;
|
|
68781
68762
|
}
|
|
68782
68763
|
const regularType = type.regularType;
|
|
@@ -68787,7 +68768,7 @@ function createTypeChecker(host) {
|
|
|
68787
68768
|
const members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
|
68788
68769
|
const regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
|
|
68789
68770
|
regularNew.flags = resolved.flags;
|
|
68790
|
-
regularNew.objectFlags |= resolved.objectFlags & ~
|
|
68771
|
+
regularNew.objectFlags |= resolved.objectFlags & ~8192 /* FreshLiteral */;
|
|
68791
68772
|
type.regularType = regularNew;
|
|
68792
68773
|
return regularNew;
|
|
68793
68774
|
}
|
|
@@ -68815,7 +68796,7 @@ function createTypeChecker(host) {
|
|
|
68815
68796
|
if (!context.resolvedProperties) {
|
|
68816
68797
|
const names = /* @__PURE__ */ new Map();
|
|
68817
68798
|
for (const t of getSiblingsOfContext(context)) {
|
|
68818
|
-
if (isObjectLiteralType2(t) && !(getObjectFlags(t) &
|
|
68799
|
+
if (isObjectLiteralType2(t) && !(getObjectFlags(t) & 2097152 /* ContainsSpread */)) {
|
|
68819
68800
|
for (const prop of getPropertiesOfType(t)) {
|
|
68820
68801
|
names.set(prop.escapedName, prop);
|
|
68821
68802
|
}
|
|
@@ -68862,7 +68843,7 @@ function createTypeChecker(host) {
|
|
|
68862
68843
|
}
|
|
68863
68844
|
}
|
|
68864
68845
|
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
68865
|
-
result.objectFlags |= getObjectFlags(type) & (
|
|
68846
|
+
result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
|
|
68866
68847
|
return result;
|
|
68867
68848
|
}
|
|
68868
68849
|
function getWidenedType(type) {
|
|
@@ -68873,7 +68854,7 @@ function createTypeChecker(host) {
|
|
|
68873
68854
|
);
|
|
68874
68855
|
}
|
|
68875
68856
|
function getWidenedTypeWithContext(type, context) {
|
|
68876
|
-
if (getObjectFlags(type) &
|
|
68857
|
+
if (getObjectFlags(type) & 196608 /* RequiresWidening */) {
|
|
68877
68858
|
if (context === void 0 && type.widened) {
|
|
68878
68859
|
return type.widened;
|
|
68879
68860
|
}
|
|
@@ -68906,7 +68887,7 @@ function createTypeChecker(host) {
|
|
|
68906
68887
|
}
|
|
68907
68888
|
function reportWideningErrorsInType(type) {
|
|
68908
68889
|
let errorReported = false;
|
|
68909
|
-
if (getObjectFlags(type) &
|
|
68890
|
+
if (getObjectFlags(type) & 65536 /* ContainsWideningType */) {
|
|
68910
68891
|
if (type.flags & 1048576 /* Union */) {
|
|
68911
68892
|
if (some(type.types, isEmptyObjectType)) {
|
|
68912
68893
|
errorReported = true;
|
|
@@ -68928,7 +68909,7 @@ function createTypeChecker(host) {
|
|
|
68928
68909
|
if (isObjectLiteralType2(type)) {
|
|
68929
68910
|
for (const p of getPropertiesOfObjectType(type)) {
|
|
68930
68911
|
const t = getTypeOfSymbol(p);
|
|
68931
|
-
if (getObjectFlags(t) &
|
|
68912
|
+
if (getObjectFlags(t) & 65536 /* ContainsWideningType */) {
|
|
68932
68913
|
if (!reportWideningErrorsInType(t)) {
|
|
68933
68914
|
error2(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
|
|
68934
68915
|
}
|
|
@@ -69016,7 +68997,7 @@ function createTypeChecker(host) {
|
|
|
69016
68997
|
}
|
|
69017
68998
|
function reportErrorsFromWidening(declaration, type, wideningKind) {
|
|
69018
68999
|
addLazyDiagnostic(() => {
|
|
69019
|
-
if (noImplicitAny && getObjectFlags(type) &
|
|
69000
|
+
if (noImplicitAny && getObjectFlags(type) & 65536 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
69020
69001
|
if (!reportWideningErrorsInType(type)) {
|
|
69021
69002
|
reportImplicitAny(declaration, type, wideningKind);
|
|
69022
69003
|
}
|
|
@@ -69153,12 +69134,12 @@ function createTypeChecker(host) {
|
|
|
69153
69134
|
}
|
|
69154
69135
|
function couldContainTypeVariables(type) {
|
|
69155
69136
|
const objectFlags = getObjectFlags(type);
|
|
69156
|
-
if (objectFlags &
|
|
69157
|
-
return !!(objectFlags &
|
|
69137
|
+
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
69138
|
+
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
69158
69139
|
}
|
|
69159
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ |
|
|
69140
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
69160
69141
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
69161
|
-
type.objectFlags |=
|
|
69142
|
+
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
69162
69143
|
}
|
|
69163
69144
|
return result;
|
|
69164
69145
|
}
|
|
@@ -69222,7 +69203,7 @@ function createTypeChecker(host) {
|
|
|
69222
69203
|
return type;
|
|
69223
69204
|
}
|
|
69224
69205
|
function isPartiallyInferableType(type) {
|
|
69225
|
-
return !(getObjectFlags(type) &
|
|
69206
|
+
return !(getObjectFlags(type) & 262144 /* NonInferrableType */) || isObjectLiteralType2(type) && some(getPropertiesOfType(type), (prop) => isPartiallyInferableType(getTypeOfSymbol(prop))) || isTupleType(type) && some(getElementTypes(type), isPartiallyInferableType);
|
|
69226
69207
|
}
|
|
69227
69208
|
function createReverseMappedType(source, target, constraint) {
|
|
69228
69209
|
if (!(getIndexInfoOfType(source, stringType) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {
|
|
@@ -69237,7 +69218,7 @@ function createTypeChecker(host) {
|
|
|
69237
69218
|
return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations);
|
|
69238
69219
|
}
|
|
69239
69220
|
const reversed = createObjectType(
|
|
69240
|
-
|
|
69221
|
+
1024 /* ReverseMapped */ | 16 /* Anonymous */,
|
|
69241
69222
|
/*symbol*/
|
|
69242
69223
|
void 0
|
|
69243
69224
|
);
|
|
@@ -69458,8 +69439,6 @@ function createTypeChecker(host) {
|
|
|
69458
69439
|
propagationType = savePropagationType;
|
|
69459
69440
|
return;
|
|
69460
69441
|
}
|
|
69461
|
-
source = getResolvedType(source);
|
|
69462
|
-
target = getResolvedType(target);
|
|
69463
69442
|
if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
|
|
69464
69443
|
if (source.aliasTypeArguments) {
|
|
69465
69444
|
const params = getSymbolLinks(source.aliasSymbol).typeParameters;
|
|
@@ -69510,7 +69489,7 @@ function createTypeChecker(host) {
|
|
|
69510
69489
|
}
|
|
69511
69490
|
const inference = getInferenceInfoForType(target);
|
|
69512
69491
|
if (inference) {
|
|
69513
|
-
if (getObjectFlags(source) &
|
|
69492
|
+
if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
69514
69493
|
return;
|
|
69515
69494
|
}
|
|
69516
69495
|
if (!inference.isFixed) {
|
|
@@ -69794,7 +69773,7 @@ function createTypeChecker(host) {
|
|
|
69794
69773
|
inferWithPriority(
|
|
69795
69774
|
inferredType,
|
|
69796
69775
|
inference.typeParameter,
|
|
69797
|
-
getObjectFlags(source) &
|
|
69776
|
+
getObjectFlags(source) & 262144 /* NonInferrableType */ ? 16 /* PartialHomomorphicMappedType */ : 8 /* HomomorphicMappedType */
|
|
69798
69777
|
);
|
|
69799
69778
|
}
|
|
69800
69779
|
}
|
|
@@ -70049,10 +70028,10 @@ function createTypeChecker(host) {
|
|
|
70049
70028
|
return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 402784252 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
|
|
70050
70029
|
}
|
|
70051
70030
|
function isObjectLiteralType2(type) {
|
|
70052
|
-
return !!(getObjectFlags(type) &
|
|
70031
|
+
return !!(getObjectFlags(type) & 128 /* ObjectLiteral */);
|
|
70053
70032
|
}
|
|
70054
70033
|
function isObjectOrArrayLiteralType(type) {
|
|
70055
|
-
return !!(getObjectFlags(type) & (
|
|
70034
|
+
return !!(getObjectFlags(type) & (128 /* ObjectLiteral */ | 16384 /* ArrayLiteral */));
|
|
70056
70035
|
}
|
|
70057
70036
|
function unionObjectAndArrayLiteralCandidates(candidates) {
|
|
70058
70037
|
if (candidates.length > 1) {
|
|
@@ -70380,7 +70359,7 @@ function createTypeChecker(host) {
|
|
|
70380
70359
|
}
|
|
70381
70360
|
function getKeyPropertyName(unionType) {
|
|
70382
70361
|
const types = unionType.types;
|
|
70383
|
-
if (types.length < 10 || getObjectFlags(unionType) &
|
|
70362
|
+
if (types.length < 10 || getObjectFlags(unionType) & 32768 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */))) < 10) {
|
|
70384
70363
|
return void 0;
|
|
70385
70364
|
}
|
|
70386
70365
|
if (unionType.keyPropertyName === void 0) {
|
|
@@ -70769,7 +70748,7 @@ function createTypeChecker(host) {
|
|
|
70769
70748
|
}
|
|
70770
70749
|
return getUnionTypeFromSortedList(
|
|
70771
70750
|
filtered,
|
|
70772
|
-
type.objectFlags & (
|
|
70751
|
+
type.objectFlags & (32768 /* PrimitiveUnion */ | 16777216 /* ContainsIntersections */),
|
|
70773
70752
|
/*aliasSymbol*/
|
|
70774
70753
|
void 0,
|
|
70775
70754
|
/*aliasTypeArguments*/
|
|
@@ -70831,7 +70810,7 @@ function createTypeChecker(host) {
|
|
|
70831
70810
|
return incomplete ? { flags: 0, type: type.flags & 131072 /* Never */ ? silentNeverType : type } : type;
|
|
70832
70811
|
}
|
|
70833
70812
|
function createEvolvingArrayType(elementType) {
|
|
70834
|
-
const result = createObjectType(
|
|
70813
|
+
const result = createObjectType(256 /* EvolvingArray */);
|
|
70835
70814
|
result.elementType = elementType;
|
|
70836
70815
|
return result;
|
|
70837
70816
|
}
|
|
@@ -70851,16 +70830,16 @@ function createTypeChecker(host) {
|
|
|
70851
70830
|
return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
|
|
70852
70831
|
}
|
|
70853
70832
|
function finalizeEvolvingArrayType(type) {
|
|
70854
|
-
return getObjectFlags(type) &
|
|
70833
|
+
return getObjectFlags(type) & 256 /* EvolvingArray */ ? getFinalArrayType(type) : type;
|
|
70855
70834
|
}
|
|
70856
70835
|
function getElementTypeOfEvolvingArrayType(type) {
|
|
70857
|
-
return getObjectFlags(type) &
|
|
70836
|
+
return getObjectFlags(type) & 256 /* EvolvingArray */ ? type.elementType : neverType;
|
|
70858
70837
|
}
|
|
70859
70838
|
function isEvolvingArrayTypeList(types) {
|
|
70860
70839
|
let hasEvolvingArrayType = false;
|
|
70861
70840
|
for (const t of types) {
|
|
70862
70841
|
if (!(t.flags & 131072 /* Never */)) {
|
|
70863
|
-
if (!(getObjectFlags(t) &
|
|
70842
|
+
if (!(getObjectFlags(t) & 256 /* EvolvingArray */)) {
|
|
70864
70843
|
return false;
|
|
70865
70844
|
}
|
|
70866
70845
|
hasEvolvingArrayType = true;
|
|
@@ -71164,7 +71143,7 @@ function createTypeChecker(host) {
|
|
|
71164
71143
|
const sharedFlowStart = sharedFlowCount;
|
|
71165
71144
|
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
|
|
71166
71145
|
sharedFlowCount = sharedFlowStart;
|
|
71167
|
-
const resultType = getObjectFlags(evolvedType) &
|
|
71146
|
+
const resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
|
|
71168
71147
|
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
|
|
71169
71148
|
return declaredType;
|
|
71170
71149
|
}
|
|
@@ -71351,7 +71330,7 @@ function createTypeChecker(host) {
|
|
|
71351
71330
|
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
|
|
71352
71331
|
const flowType = getTypeAtFlowNode(flow.antecedent);
|
|
71353
71332
|
const type = getTypeFromFlowType(flowType);
|
|
71354
|
-
if (getObjectFlags(type) &
|
|
71333
|
+
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
|
|
71355
71334
|
let evolvedType2 = type;
|
|
71356
71335
|
if (node.kind === 213 /* CallExpression */) {
|
|
71357
71336
|
for (const arg of node.arguments) {
|
|
@@ -72204,7 +72183,7 @@ function createTypeChecker(host) {
|
|
|
72204
72183
|
location = location.parent;
|
|
72205
72184
|
}
|
|
72206
72185
|
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
|
|
72207
|
-
const type =
|
|
72186
|
+
const type = removeOptionalTypeMarker(
|
|
72208
72187
|
isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
|
|
72209
72188
|
location,
|
|
72210
72189
|
/*checkMode*/
|
|
@@ -72212,7 +72191,7 @@ function createTypeChecker(host) {
|
|
|
72212
72191
|
/*writeOnly*/
|
|
72213
72192
|
true
|
|
72214
72193
|
) : getTypeOfExpression(location)
|
|
72215
|
-
)
|
|
72194
|
+
);
|
|
72216
72195
|
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
|
|
72217
72196
|
return type;
|
|
72218
72197
|
}
|
|
@@ -74260,7 +74239,7 @@ function createTypeChecker(host) {
|
|
|
74260
74239
|
let literalType = type.literalType;
|
|
74261
74240
|
if (!literalType) {
|
|
74262
74241
|
literalType = type.literalType = cloneTypeReference(type);
|
|
74263
|
-
literalType.objectFlags |=
|
|
74242
|
+
literalType.objectFlags |= 16384 /* ArrayLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
74264
74243
|
}
|
|
74265
74244
|
return literalType;
|
|
74266
74245
|
}
|
|
@@ -74388,7 +74367,7 @@ function createTypeChecker(host) {
|
|
|
74388
74367
|
checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
|
|
74389
74368
|
}
|
|
74390
74369
|
}
|
|
74391
|
-
objectFlags |= getObjectFlags(type) &
|
|
74370
|
+
objectFlags |= getObjectFlags(type) & 458752 /* PropagatingFlags */;
|
|
74392
74371
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
74393
74372
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
74394
74373
|
if (nameType) {
|
|
@@ -74399,7 +74378,7 @@ function createTypeChecker(host) {
|
|
|
74399
74378
|
if (isOptional) {
|
|
74400
74379
|
prop.flags |= 16777216 /* Optional */;
|
|
74401
74380
|
}
|
|
74402
|
-
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) &
|
|
74381
|
+
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 512 /* ObjectLiteralPatternWithComputedProperties */)) {
|
|
74403
74382
|
const impliedProp = getPropertyOfType(contextualType, member.escapedName);
|
|
74404
74383
|
if (impliedProp) {
|
|
74405
74384
|
prop.flags |= impliedProp.flags & 16777216 /* Optional */;
|
|
@@ -74511,12 +74490,12 @@ function createTypeChecker(host) {
|
|
|
74511
74490
|
if (hasComputedSymbolProperty)
|
|
74512
74491
|
indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
|
|
74513
74492
|
const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, indexInfos);
|
|
74514
|
-
result.objectFlags |= objectFlags |
|
|
74493
|
+
result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
74515
74494
|
if (isJSObjectLiteral) {
|
|
74516
|
-
result.objectFlags |=
|
|
74495
|
+
result.objectFlags |= 4096 /* JSLiteral */;
|
|
74517
74496
|
}
|
|
74518
74497
|
if (patternWithComputedProperties) {
|
|
74519
|
-
result.objectFlags |=
|
|
74498
|
+
result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */;
|
|
74520
74499
|
}
|
|
74521
74500
|
if (inDestructuringPattern) {
|
|
74522
74501
|
result.pattern = node;
|
|
@@ -74578,13 +74557,13 @@ function createTypeChecker(host) {
|
|
|
74578
74557
|
let hasSpreadAnyType = false;
|
|
74579
74558
|
let typeToIntersect;
|
|
74580
74559
|
let explicitlySpecifyChildrenAttribute = false;
|
|
74581
|
-
let objectFlags =
|
|
74560
|
+
let objectFlags = 2048 /* JsxAttributes */;
|
|
74582
74561
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
|
|
74583
74562
|
for (const attributeDecl of attributes.properties) {
|
|
74584
74563
|
const member = attributeDecl.symbol;
|
|
74585
74564
|
if (isJsxAttribute(attributeDecl)) {
|
|
74586
74565
|
const exprType = checkJsxAttribute(attributeDecl, checkMode);
|
|
74587
|
-
objectFlags |= getObjectFlags(exprType) &
|
|
74566
|
+
objectFlags |= getObjectFlags(exprType) & 458752 /* PropagatingFlags */;
|
|
74588
74567
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
74589
74568
|
attributeSymbol.declarations = member.declarations;
|
|
74590
74569
|
attributeSymbol.parent = member.parent;
|
|
@@ -74705,7 +74684,7 @@ function createTypeChecker(host) {
|
|
|
74705
74684
|
function createJsxAttributesType() {
|
|
74706
74685
|
objectFlags |= freshObjectLiteralFlag;
|
|
74707
74686
|
const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, emptyArray);
|
|
74708
|
-
result.objectFlags |= objectFlags |
|
|
74687
|
+
result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
74709
74688
|
return result;
|
|
74710
74689
|
}
|
|
74711
74690
|
}
|
|
@@ -75098,7 +75077,7 @@ function createTypeChecker(host) {
|
|
|
75098
75077
|
return false;
|
|
75099
75078
|
}
|
|
75100
75079
|
function isExcessPropertyCheckTarget(type) {
|
|
75101
|
-
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) &
|
|
75080
|
+
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) & 512 /* ObjectLiteralPatternWithComputedProperties */) || type.flags & 67108864 /* NonPrimitive */ || type.flags & 1048576 /* Union */ && some(type.types, isExcessPropertyCheckTarget) || type.flags & 2097152 /* Intersection */ && every(type.types, isExcessPropertyCheckTarget));
|
|
75102
75081
|
}
|
|
75103
75082
|
function checkJsxExpression(node, checkMode) {
|
|
75104
75083
|
checkGrammarJsxExpression(node);
|
|
@@ -77866,7 +77845,7 @@ function createTypeChecker(host) {
|
|
|
77866
77845
|
);
|
|
77867
77846
|
if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) {
|
|
77868
77847
|
const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray);
|
|
77869
|
-
jsAssignmentType.objectFlags |=
|
|
77848
|
+
jsAssignmentType.objectFlags |= 4096 /* JSLiteral */;
|
|
77870
77849
|
return getIntersectionType([returnType, jsAssignmentType]);
|
|
77871
77850
|
}
|
|
77872
77851
|
}
|
|
@@ -78212,7 +78191,7 @@ function createTypeChecker(host) {
|
|
|
78212
78191
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
78213
78192
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
78214
78193
|
const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
78215
|
-
result3.objectFlags |=
|
|
78194
|
+
result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
|
|
78216
78195
|
result3.node = node;
|
|
78217
78196
|
return result3;
|
|
78218
78197
|
}
|
|
@@ -79253,7 +79232,7 @@ function createTypeChecker(host) {
|
|
|
79253
79232
|
64 /* IsNonInferrable */
|
|
79254
79233
|
);
|
|
79255
79234
|
const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
|
|
79256
|
-
returnOnlyType.objectFlags |=
|
|
79235
|
+
returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
|
|
79257
79236
|
return links.contextFreeType = returnOnlyType;
|
|
79258
79237
|
}
|
|
79259
79238
|
}
|
|
@@ -90029,7 +90008,7 @@ function createTypeChecker(host) {
|
|
|
90029
90008
|
}
|
|
90030
90009
|
}
|
|
90031
90010
|
function findBestTypeForObjectLiteral(source, unionTarget) {
|
|
90032
|
-
if (getObjectFlags(source) &
|
|
90011
|
+
if (getObjectFlags(source) & 128 /* ObjectLiteral */ && someType(unionTarget, isArrayLikeType)) {
|
|
90033
90012
|
return find(unionTarget.types, (t) => !isArrayLikeType(t));
|
|
90034
90013
|
}
|
|
90035
90014
|
}
|
|
@@ -151051,7 +151030,8 @@ function getTypeExportSpecifiers(originExportSpecifier, context) {
|
|
|
151051
151030
|
// src/services/codefixes/convertToTypeOnlyImport.ts
|
|
151052
151031
|
var errorCodes14 = [
|
|
151053
151032
|
Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code,
|
|
151054
|
-
Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code
|
|
151033
|
+
Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,
|
|
151034
|
+
Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code
|
|
151055
151035
|
];
|
|
151056
151036
|
var fixId13 = "convertToTypeOnlyImport";
|
|
151057
151037
|
registerCodeFix({
|
|
@@ -152231,7 +152211,7 @@ function compareModuleSpecifiers(a, b, importingFile, program, allowsImportingSp
|
|
|
152231
152211
|
}
|
|
152232
152212
|
function isFixPossiblyReExportingImportingFile(fix, importingFile, compilerOptions, toPath3) {
|
|
152233
152213
|
var _a;
|
|
152234
|
-
if (fix.isReExport && ((_a = fix.exportInfo) == null ? void 0 : _a.moduleFileName) &&
|
|
152214
|
+
if (fix.isReExport && ((_a = fix.exportInfo) == null ? void 0 : _a.moduleFileName) && isIndexFileName(fix.exportInfo.moduleFileName)) {
|
|
152235
152215
|
const reExportDir = toPath3(getDirectoryPath(fix.exportInfo.moduleFileName));
|
|
152236
152216
|
return startsWith(importingFile.path, reExportDir);
|
|
152237
152217
|
}
|
|
@@ -154342,7 +154322,7 @@ function createUndefined() {
|
|
|
154342
154322
|
return factory.createIdentifier("undefined");
|
|
154343
154323
|
}
|
|
154344
154324
|
function isObjectLiteralType(type) {
|
|
154345
|
-
return type.flags & 524288 /* Object */ && (getObjectFlags(type) &
|
|
154325
|
+
return type.flags & 524288 /* Object */ && (getObjectFlags(type) & 128 /* ObjectLiteral */ || type.symbol && tryCast(singleOrUndefined(type.symbol.declarations), isTypeLiteralNode));
|
|
154346
154326
|
}
|
|
154347
154327
|
function getUnmatchedAttributes(checker, target, source) {
|
|
154348
154328
|
const attrsType = checker.getContextualType(source.attributes);
|
|
@@ -163132,7 +163112,13 @@ function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, ext
|
|
|
163132
163112
|
if (exclude && comparePaths(filePath, exclude, scriptDirectory, ignoreCase) === 0 /* EqualTo */) {
|
|
163133
163113
|
continue;
|
|
163134
163114
|
}
|
|
163135
|
-
const { name, extension } = getFilenameWithExtensionOption(
|
|
163115
|
+
const { name, extension } = getFilenameWithExtensionOption(
|
|
163116
|
+
getBaseFileName(filePath),
|
|
163117
|
+
host.getCompilationSettings(),
|
|
163118
|
+
extensionOptions,
|
|
163119
|
+
/*isExportsWildcard*/
|
|
163120
|
+
false
|
|
163121
|
+
);
|
|
163136
163122
|
result.add(nameAndKind(name, "script" /* scriptElement */, extension));
|
|
163137
163123
|
}
|
|
163138
163124
|
}
|
|
@@ -163147,7 +163133,7 @@ function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, ext
|
|
|
163147
163133
|
}
|
|
163148
163134
|
return result;
|
|
163149
163135
|
}
|
|
163150
|
-
function getFilenameWithExtensionOption(name, compilerOptions, extensionOptions) {
|
|
163136
|
+
function getFilenameWithExtensionOption(name, compilerOptions, extensionOptions, isExportsWildcard) {
|
|
163151
163137
|
const nonJsResult = ts_moduleSpecifiers_exports.tryGetRealFileNameForNonJsDeclarationFileName(name);
|
|
163152
163138
|
if (nonJsResult) {
|
|
163153
163139
|
return { name: nonJsResult, extension: tryGetExtensionFromPath2(nonJsResult) };
|
|
@@ -163155,15 +163141,22 @@ function getFilenameWithExtensionOption(name, compilerOptions, extensionOptions)
|
|
|
163155
163141
|
if (extensionOptions.referenceKind === 0 /* Filename */) {
|
|
163156
163142
|
return { name, extension: tryGetExtensionFromPath2(name) };
|
|
163157
163143
|
}
|
|
163158
|
-
|
|
163159
|
-
|
|
163144
|
+
let allowedEndings = getModuleSpecifierPreferences(
|
|
163145
|
+
{ importModuleSpecifierEnding: extensionOptions.endingPreference },
|
|
163146
|
+
compilerOptions,
|
|
163147
|
+
extensionOptions.importingSourceFile
|
|
163148
|
+
).getAllowedEndingsInPreferredOrder(extensionOptions.resolutionMode);
|
|
163149
|
+
if (isExportsWildcard) {
|
|
163150
|
+
allowedEndings = allowedEndings.filter((e) => e !== 0 /* Minimal */ && e !== 1 /* Index */);
|
|
163151
|
+
}
|
|
163152
|
+
if (allowedEndings[0] === 3 /* TsExtension */) {
|
|
163160
163153
|
if (fileExtensionIsOneOf(name, supportedTSImplementationExtensions)) {
|
|
163161
163154
|
return { name, extension: tryGetExtensionFromPath2(name) };
|
|
163162
163155
|
}
|
|
163163
163156
|
const outputExtension2 = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name, compilerOptions);
|
|
163164
163157
|
return outputExtension2 ? { name: changeExtension(name, outputExtension2), extension: outputExtension2 } : { name, extension: tryGetExtensionFromPath2(name) };
|
|
163165
163158
|
}
|
|
163166
|
-
if ((
|
|
163159
|
+
if (!isExportsWildcard && (allowedEndings[0] === 0 /* Minimal */ || allowedEndings[0] === 1 /* Index */) && fileExtensionIsOneOf(name, [".js" /* Js */, ".jsx" /* Jsx */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */])) {
|
|
163167
163160
|
return { name: removeFileExtension(name), extension: tryGetExtensionFromPath2(name) };
|
|
163168
163161
|
}
|
|
163169
163162
|
const outputExtension = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name, compilerOptions);
|
|
@@ -163178,9 +163171,20 @@ function addCompletionEntriesFromPaths(result, fragment, baseDirectory, extensio
|
|
|
163178
163171
|
const lengthB = typeof patternB === "object" ? patternB.prefix.length : b.length;
|
|
163179
163172
|
return compareValues(lengthB, lengthA);
|
|
163180
163173
|
};
|
|
163181
|
-
return addCompletionEntriesFromPathsOrExports(
|
|
163174
|
+
return addCompletionEntriesFromPathsOrExports(
|
|
163175
|
+
result,
|
|
163176
|
+
/*isExports*/
|
|
163177
|
+
false,
|
|
163178
|
+
fragment,
|
|
163179
|
+
baseDirectory,
|
|
163180
|
+
extensionOptions,
|
|
163181
|
+
host,
|
|
163182
|
+
getOwnKeys(paths),
|
|
163183
|
+
getPatternsForKey,
|
|
163184
|
+
comparePaths2
|
|
163185
|
+
);
|
|
163182
163186
|
}
|
|
163183
|
-
function addCompletionEntriesFromPathsOrExports(result, fragment, baseDirectory, extensionOptions, host, keys, getPatternsForKey, comparePaths2) {
|
|
163187
|
+
function addCompletionEntriesFromPathsOrExports(result, isExports, fragment, baseDirectory, extensionOptions, host, keys, getPatternsForKey, comparePaths2) {
|
|
163184
163188
|
let pathResults = [];
|
|
163185
163189
|
let matchedPath;
|
|
163186
163190
|
for (const key of keys) {
|
|
@@ -163201,7 +163205,7 @@ function addCompletionEntriesFromPathsOrExports(result, fragment, baseDirectory,
|
|
|
163201
163205
|
if (typeof pathPattern === "string" || matchedPath === void 0 || comparePaths2(key, matchedPath) !== 1 /* GreaterThan */) {
|
|
163202
163206
|
pathResults.push({
|
|
163203
163207
|
matchedPattern: isMatch,
|
|
163204
|
-
results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, host).map(({ name, kind, extension }) => nameAndKind(name, kind, extension))
|
|
163208
|
+
results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, isExports && isMatch, host).map(({ name, kind, extension }) => nameAndKind(name, kind, extension))
|
|
163205
163209
|
});
|
|
163206
163210
|
}
|
|
163207
163211
|
}
|
|
@@ -163304,6 +163308,8 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, c
|
|
|
163304
163308
|
const conditions = getConditions(compilerOptions, mode);
|
|
163305
163309
|
addCompletionEntriesFromPathsOrExports(
|
|
163306
163310
|
result,
|
|
163311
|
+
/*isExports*/
|
|
163312
|
+
true,
|
|
163307
163313
|
fragmentSubpath,
|
|
163308
163314
|
packageDirectory,
|
|
163309
163315
|
extensionOptions,
|
|
@@ -163339,7 +163345,7 @@ function getPatternFromFirstMatchingCondition(target, conditions) {
|
|
|
163339
163345
|
function getFragmentDirectory(fragment) {
|
|
163340
163346
|
return containsSlash(fragment) ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0;
|
|
163341
163347
|
}
|
|
163342
|
-
function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, host) {
|
|
163348
|
+
function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, isExportsWildcard, host) {
|
|
163343
163349
|
if (!endsWith(path, "*")) {
|
|
163344
163350
|
return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
|
|
163345
163351
|
}
|
|
@@ -163349,15 +163355,15 @@ function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory
|
|
|
163349
163355
|
const starIsFullPathComponent = path[path.length - 2] === "/";
|
|
163350
163356
|
return starIsFullPathComponent ? justPathMappingName(pathPrefix, "directory" /* directory */) : flatMap(patterns, (pattern) => {
|
|
163351
163357
|
var _a;
|
|
163352
|
-
return (_a = getModulesForPathsPattern("", packageDirectory, pattern, extensionOptions, host)) == null ? void 0 : _a.map(({ name, ...rest }) => ({ name: pathPrefix + name, ...rest }));
|
|
163358
|
+
return (_a = getModulesForPathsPattern("", packageDirectory, pattern, extensionOptions, isExportsWildcard, host)) == null ? void 0 : _a.map(({ name, ...rest }) => ({ name: pathPrefix + name, ...rest }));
|
|
163353
163359
|
});
|
|
163354
163360
|
}
|
|
163355
|
-
return flatMap(patterns, (pattern) => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, host));
|
|
163361
|
+
return flatMap(patterns, (pattern) => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, isExportsWildcard, host));
|
|
163356
163362
|
function justPathMappingName(name, kind) {
|
|
163357
163363
|
return startsWith(name, fragment) ? [{ name: removeTrailingDirectorySeparator(name), kind, extension: void 0 }] : emptyArray;
|
|
163358
163364
|
}
|
|
163359
163365
|
}
|
|
163360
|
-
function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensionOptions, host) {
|
|
163366
|
+
function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensionOptions, isExportsWildcard, host) {
|
|
163361
163367
|
if (!host.readDirectory) {
|
|
163362
163368
|
return void 0;
|
|
163363
163369
|
}
|
|
@@ -163390,7 +163396,7 @@ function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensio
|
|
|
163390
163396
|
if (containsSlash(trimmedWithPattern)) {
|
|
163391
163397
|
return directoryResult(getPathComponents(removeLeadingDirectorySeparator(trimmedWithPattern))[1]);
|
|
163392
163398
|
}
|
|
163393
|
-
const { name, extension } = getFilenameWithExtensionOption(trimmedWithPattern, host.getCompilationSettings(), extensionOptions);
|
|
163399
|
+
const { name, extension } = getFilenameWithExtensionOption(trimmedWithPattern, host.getCompilationSettings(), extensionOptions, isExportsWildcard);
|
|
163394
163400
|
return nameAndKind(name, "script" /* scriptElement */, extension);
|
|
163395
163401
|
}
|
|
163396
163402
|
});
|