@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/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240208`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -1746,8 +1746,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1746
1746
|
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
|
|
1747
1747
|
__tsDebuggerDisplay: {
|
|
1748
1748
|
value() {
|
|
1749
|
-
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 &
|
|
1750
|
-
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~
|
|
1749
|
+
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";
|
|
1750
|
+
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
|
|
1751
1751
|
return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`;
|
|
1752
1752
|
}
|
|
1753
1753
|
},
|
|
@@ -2926,7 +2926,7 @@ var tracingEnabled;
|
|
|
2926
2926
|
};
|
|
2927
2927
|
}
|
|
2928
2928
|
let reverseMappedProperties = {};
|
|
2929
|
-
if (objectFlags &
|
|
2929
|
+
if (objectFlags & 1024 /* ReverseMapped */) {
|
|
2930
2930
|
const reverseMappedType = type;
|
|
2931
2931
|
reverseMappedProperties = {
|
|
2932
2932
|
reverseMappedSourceType: (_l = reverseMappedType.source) == null ? void 0 : _l.id,
|
|
@@ -2935,7 +2935,7 @@ var tracingEnabled;
|
|
|
2935
2935
|
};
|
|
2936
2936
|
}
|
|
2937
2937
|
let evolvingArrayProperties = {};
|
|
2938
|
-
if (objectFlags &
|
|
2938
|
+
if (objectFlags & 256 /* EvolvingArray */) {
|
|
2939
2939
|
const evolvingArrayType = type;
|
|
2940
2940
|
evolvingArrayProperties = {
|
|
2941
2941
|
evolvingArrayElementType: evolvingArrayType.elementType.id,
|
|
@@ -3685,43 +3685,42 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
3685
3685
|
ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple";
|
|
3686
3686
|
ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous";
|
|
3687
3687
|
ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped";
|
|
3688
|
-
ObjectFlags3[ObjectFlags3["
|
|
3689
|
-
ObjectFlags3[ObjectFlags3["
|
|
3690
|
-
ObjectFlags3[ObjectFlags3["
|
|
3691
|
-
ObjectFlags3[ObjectFlags3["
|
|
3692
|
-
ObjectFlags3[ObjectFlags3["
|
|
3693
|
-
ObjectFlags3[ObjectFlags3["
|
|
3694
|
-
ObjectFlags3[ObjectFlags3["
|
|
3695
|
-
ObjectFlags3[ObjectFlags3["
|
|
3696
|
-
ObjectFlags3[ObjectFlags3["
|
|
3697
|
-
ObjectFlags3[ObjectFlags3["
|
|
3698
|
-
ObjectFlags3[ObjectFlags3["
|
|
3699
|
-
ObjectFlags3[ObjectFlags3["
|
|
3700
|
-
ObjectFlags3[ObjectFlags3["
|
|
3701
|
-
ObjectFlags3[ObjectFlags3["
|
|
3702
|
-
ObjectFlags3[ObjectFlags3["
|
|
3703
|
-
ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
|
|
3688
|
+
ObjectFlags3[ObjectFlags3["Instantiated"] = 64] = "Instantiated";
|
|
3689
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 128] = "ObjectLiteral";
|
|
3690
|
+
ObjectFlags3[ObjectFlags3["EvolvingArray"] = 256] = "EvolvingArray";
|
|
3691
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties";
|
|
3692
|
+
ObjectFlags3[ObjectFlags3["ReverseMapped"] = 1024] = "ReverseMapped";
|
|
3693
|
+
ObjectFlags3[ObjectFlags3["JsxAttributes"] = 2048] = "JsxAttributes";
|
|
3694
|
+
ObjectFlags3[ObjectFlags3["JSLiteral"] = 4096] = "JSLiteral";
|
|
3695
|
+
ObjectFlags3[ObjectFlags3["FreshLiteral"] = 8192] = "FreshLiteral";
|
|
3696
|
+
ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 16384] = "ArrayLiteral";
|
|
3697
|
+
ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 32768] = "PrimitiveUnion";
|
|
3698
|
+
ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 65536] = "ContainsWideningType";
|
|
3699
|
+
ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 131072] = "ContainsObjectOrArrayLiteral";
|
|
3700
|
+
ObjectFlags3[ObjectFlags3["NonInferrableType"] = 262144] = "NonInferrableType";
|
|
3701
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed";
|
|
3702
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables";
|
|
3704
3703
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
3705
|
-
ObjectFlags3[ObjectFlags3["RequiresWidening"] =
|
|
3706
|
-
ObjectFlags3[ObjectFlags3["PropagatingFlags"] =
|
|
3707
|
-
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] =
|
|
3708
|
-
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] =
|
|
3709
|
-
ObjectFlags3[ObjectFlags3["ContainsSpread"] =
|
|
3710
|
-
ObjectFlags3[ObjectFlags3["ObjectRestType"] =
|
|
3711
|
-
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] =
|
|
3712
|
-
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] =
|
|
3713
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] =
|
|
3714
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] =
|
|
3715
|
-
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] =
|
|
3716
|
-
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] =
|
|
3717
|
-
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] =
|
|
3718
|
-
ObjectFlags3[ObjectFlags3["IsGenericType"] =
|
|
3719
|
-
ObjectFlags3[ObjectFlags3["ContainsIntersections"] =
|
|
3720
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] =
|
|
3721
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] =
|
|
3722
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] =
|
|
3723
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] =
|
|
3724
|
-
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] =
|
|
3704
|
+
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening";
|
|
3705
|
+
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags";
|
|
3706
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 96] = "InstantiatedMapped";
|
|
3707
|
+
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask";
|
|
3708
|
+
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
3709
|
+
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
3710
|
+
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
|
|
3711
|
+
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
|
|
3712
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
|
|
3713
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
|
|
3714
|
+
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 2097152] = "IsGenericTypeComputed";
|
|
3715
|
+
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 4194304] = "IsGenericObjectType";
|
|
3716
|
+
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 8388608] = "IsGenericIndexType";
|
|
3717
|
+
ObjectFlags3[ObjectFlags3["IsGenericType"] = 12582912] = "IsGenericType";
|
|
3718
|
+
ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 16777216] = "ContainsIntersections";
|
|
3719
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 33554432] = "IsUnknownLikeUnionComputed";
|
|
3720
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion";
|
|
3721
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed";
|
|
3722
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 33554432] = "IsNeverIntersection";
|
|
3723
|
+
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 67108864] = "IsConstrainedTypeVariable";
|
|
3725
3724
|
return ObjectFlags3;
|
|
3726
3725
|
})(ObjectFlags || {});
|
|
3727
3726
|
var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
|
|
@@ -17042,7 +17041,8 @@ function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtens
|
|
|
17042
17041
|
}
|
|
17043
17042
|
function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) {
|
|
17044
17043
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
17045
|
-
|
|
17044
|
+
const moduleResolutionIsNodeNext = 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */;
|
|
17045
|
+
if (preference === "js" || resolutionMode === 99 /* ESNext */ && moduleResolutionIsNodeNext) {
|
|
17046
17046
|
if (!shouldAllowImportingTsExtension(compilerOptions)) {
|
|
17047
17047
|
return 2 /* JsExtension */;
|
|
17048
17048
|
}
|
|
@@ -17060,16 +17060,19 @@ function getModuleSpecifierEndingPreference(preference, resolutionMode, compiler
|
|
|
17060
17060
|
return inferPreference();
|
|
17061
17061
|
function inferPreference() {
|
|
17062
17062
|
let usesJsExtensions = false;
|
|
17063
|
-
const specifiers = sourceFile.imports.length ? sourceFile.imports
|
|
17063
|
+
const specifiers = sourceFile.imports.length ? sourceFile.imports : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0]) : emptyArray;
|
|
17064
17064
|
for (const specifier of specifiers) {
|
|
17065
|
-
if (pathIsRelative(specifier)) {
|
|
17066
|
-
if (
|
|
17065
|
+
if (pathIsRelative(specifier.text)) {
|
|
17066
|
+
if (moduleResolutionIsNodeNext && resolutionMode === 1 /* CommonJS */ && getModeForUsageLocation(sourceFile, specifier, compilerOptions) === 99 /* ESNext */) {
|
|
17067
17067
|
continue;
|
|
17068
17068
|
}
|
|
17069
|
-
if (
|
|
17069
|
+
if (fileExtensionIsOneOf(specifier.text, extensionsNotSupportingExtensionlessResolution)) {
|
|
17070
|
+
continue;
|
|
17071
|
+
}
|
|
17072
|
+
if (hasTSFileExtension(specifier.text)) {
|
|
17070
17073
|
return 3 /* TsExtension */;
|
|
17071
17074
|
}
|
|
17072
|
-
if (hasJSFileExtension(specifier)) {
|
|
17075
|
+
if (hasJSFileExtension(specifier.text)) {
|
|
17073
17076
|
usesJsExtensions = true;
|
|
17074
17077
|
}
|
|
17075
17078
|
}
|
|
@@ -42626,11 +42629,12 @@ function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignatu
|
|
|
42626
42629
|
}
|
|
42627
42630
|
|
|
42628
42631
|
// src/compiler/moduleSpecifiers.ts
|
|
42629
|
-
function
|
|
42630
|
-
const
|
|
42632
|
+
function getModuleSpecifierPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding }, compilerOptions, importingSourceFile, oldImportSpecifier) {
|
|
42633
|
+
const filePreferredEnding = getPreferredEnding();
|
|
42631
42634
|
return {
|
|
42632
42635
|
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 */,
|
|
42633
42636
|
getAllowedEndingsInPreferredOrder: (syntaxImpliedNodeFormat) => {
|
|
42637
|
+
const preferredEnding = syntaxImpliedNodeFormat !== importingSourceFile.impliedNodeFormat ? getPreferredEnding(syntaxImpliedNodeFormat) : filePreferredEnding;
|
|
42634
42638
|
if ((syntaxImpliedNodeFormat ?? importingSourceFile.impliedNodeFormat) === 99 /* ESNext */) {
|
|
42635
42639
|
if (shouldAllowImportingTsExtension(compilerOptions, importingSourceFile.fileName)) {
|
|
42636
42640
|
return [3 /* TsExtension */, 2 /* JsExtension */];
|
|
@@ -42655,7 +42659,7 @@ function getPreferences({ importModuleSpecifierPreference, importModuleSpecifier
|
|
|
42655
42659
|
}
|
|
42656
42660
|
}
|
|
42657
42661
|
};
|
|
42658
|
-
function getPreferredEnding() {
|
|
42662
|
+
function getPreferredEnding(resolutionMode) {
|
|
42659
42663
|
if (oldImportSpecifier !== void 0) {
|
|
42660
42664
|
if (hasJSFileExtension(oldImportSpecifier))
|
|
42661
42665
|
return 2 /* JsExtension */;
|
|
@@ -42664,14 +42668,14 @@ function getPreferences({ importModuleSpecifierPreference, importModuleSpecifier
|
|
|
42664
42668
|
}
|
|
42665
42669
|
return getModuleSpecifierEndingPreference(
|
|
42666
42670
|
importModuleSpecifierEnding,
|
|
42667
|
-
importingSourceFile.impliedNodeFormat,
|
|
42671
|
+
resolutionMode ?? importingSourceFile.impliedNodeFormat,
|
|
42668
42672
|
compilerOptions,
|
|
42669
42673
|
importingSourceFile
|
|
42670
42674
|
);
|
|
42671
42675
|
}
|
|
42672
42676
|
}
|
|
42673
42677
|
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, options = {}) {
|
|
42674
|
-
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host,
|
|
42678
|
+
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile), {}, options);
|
|
42675
42679
|
}
|
|
42676
42680
|
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, preferences, userPreferences, options = {}) {
|
|
42677
42681
|
const info = getInfo(importingSourceFileName, host);
|
|
@@ -42743,7 +42747,7 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
|
|
|
42743
42747
|
}
|
|
42744
42748
|
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
42745
42749
|
const info = getInfo(importingSourceFile.fileName, host);
|
|
42746
|
-
const preferences =
|
|
42750
|
+
const preferences = getModuleSpecifierPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
42747
42751
|
const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
|
|
42748
42752
|
host.getFileIncludeReasons().get(toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)),
|
|
42749
42753
|
(reason) => {
|
|
@@ -43253,7 +43257,7 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
43253
43257
|
if (!parts) {
|
|
43254
43258
|
return void 0;
|
|
43255
43259
|
}
|
|
43256
|
-
const preferences =
|
|
43260
|
+
const preferences = getModuleSpecifierPreferences(userPreferences, options, importingSourceFile);
|
|
43257
43261
|
const allowedEndings = preferences.getAllowedEndingsInPreferredOrder();
|
|
43258
43262
|
let moduleSpecifier = path;
|
|
43259
43263
|
let isPackageRootPath = false;
|
|
@@ -43644,7 +43648,7 @@ function createTypeChecker(host) {
|
|
|
43644
43648
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
43645
43649
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
43646
43650
|
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
43647
|
-
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 :
|
|
43651
|
+
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
|
|
43648
43652
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
43649
43653
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
43650
43654
|
var emitResolver = createResolver();
|
|
@@ -44147,7 +44151,7 @@ function createTypeChecker(host) {
|
|
|
44147
44151
|
var errorTypes = /* @__PURE__ */ new Map();
|
|
44148
44152
|
var seenIntrinsicNames = /* @__PURE__ */ new Set();
|
|
44149
44153
|
var anyType = createIntrinsicType(1 /* Any */, "any");
|
|
44150
|
-
var autoType = createIntrinsicType(1 /* Any */, "any",
|
|
44154
|
+
var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */, "auto");
|
|
44151
44155
|
var wildcardType = createIntrinsicType(
|
|
44152
44156
|
1 /* Any */,
|
|
44153
44157
|
"any",
|
|
@@ -44164,7 +44168,7 @@ function createTypeChecker(host) {
|
|
|
44164
44168
|
);
|
|
44165
44169
|
var errorType = createIntrinsicType(1 /* Any */, "error");
|
|
44166
44170
|
var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
|
|
44167
|
-
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any",
|
|
44171
|
+
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */, "non-inferrable");
|
|
44168
44172
|
var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
|
|
44169
44173
|
var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
44170
44174
|
var nonNullUnknownType = createIntrinsicType(
|
|
@@ -44175,7 +44179,7 @@ function createTypeChecker(host) {
|
|
|
44175
44179
|
"non-null"
|
|
44176
44180
|
);
|
|
44177
44181
|
var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
44178
|
-
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined",
|
|
44182
|
+
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */, "widening");
|
|
44179
44183
|
var missingType = createIntrinsicType(
|
|
44180
44184
|
32768 /* Undefined */,
|
|
44181
44185
|
"undefined",
|
|
@@ -44192,7 +44196,7 @@ function createTypeChecker(host) {
|
|
|
44192
44196
|
"optional"
|
|
44193
44197
|
);
|
|
44194
44198
|
var nullType = createIntrinsicType(65536 /* Null */, "null");
|
|
44195
|
-
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null",
|
|
44199
|
+
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */, "widening");
|
|
44196
44200
|
var stringType = createIntrinsicType(4 /* String */, "string");
|
|
44197
44201
|
var numberType = createIntrinsicType(8 /* Number */, "number");
|
|
44198
44202
|
var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
|
|
@@ -44224,7 +44228,7 @@ function createTypeChecker(host) {
|
|
|
44224
44228
|
var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol");
|
|
44225
44229
|
var voidType = createIntrinsicType(16384 /* Void */, "void");
|
|
44226
44230
|
var neverType = createIntrinsicType(131072 /* Never */, "never");
|
|
44227
|
-
var silentNeverType = createIntrinsicType(131072 /* Never */, "never",
|
|
44231
|
+
var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */, "silent");
|
|
44228
44232
|
var implicitNeverType = createIntrinsicType(
|
|
44229
44233
|
131072 /* Never */,
|
|
44230
44234
|
"never",
|
|
@@ -44291,7 +44295,7 @@ function createTypeChecker(host) {
|
|
|
44291
44295
|
emptyArray,
|
|
44292
44296
|
emptyArray
|
|
44293
44297
|
);
|
|
44294
|
-
emptyJsxObjectType.objectFlags |=
|
|
44298
|
+
emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */;
|
|
44295
44299
|
var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
44296
44300
|
emptyTypeLiteralSymbol.members = createSymbolTable();
|
|
44297
44301
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
@@ -44321,7 +44325,7 @@ function createTypeChecker(host) {
|
|
|
44321
44325
|
emptyArray,
|
|
44322
44326
|
emptyArray
|
|
44323
44327
|
);
|
|
44324
|
-
anyFunctionType.objectFlags |=
|
|
44328
|
+
anyFunctionType.objectFlags |= 262144 /* NonInferrableType */;
|
|
44325
44329
|
var noConstraintType = createAnonymousType(
|
|
44326
44330
|
/*symbol*/
|
|
44327
44331
|
void 0,
|
|
@@ -47559,7 +47563,7 @@ function createTypeChecker(host) {
|
|
|
47559
47563
|
const type = createType(kind);
|
|
47560
47564
|
type.intrinsicName = intrinsicName;
|
|
47561
47565
|
type.debugIntrinsicName = debugIntrinsicName;
|
|
47562
|
-
type.objectFlags = objectFlags |
|
|
47566
|
+
type.objectFlags = objectFlags | 524288 /* CouldContainTypeVariablesComputed */ | 2097152 /* IsGenericTypeComputed */ | 33554432 /* IsUnknownLikeUnionComputed */ | 16777216 /* IsNeverIntersectionComputed */;
|
|
47563
47567
|
return type;
|
|
47564
47568
|
}
|
|
47565
47569
|
function checkIntrinsicName(name, debug) {
|
|
@@ -48148,7 +48152,7 @@ function createTypeChecker(host) {
|
|
|
48148
48152
|
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
48149
48153
|
}
|
|
48150
48154
|
function isClassInstanceSide(type) {
|
|
48151
|
-
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) &
|
|
48155
|
+
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 16777216 /* IsClassInstanceClone */));
|
|
48152
48156
|
}
|
|
48153
48157
|
function createNodeBuilder() {
|
|
48154
48158
|
return {
|
|
@@ -48237,7 +48241,9 @@ function createTypeChecker(host) {
|
|
|
48237
48241
|
context.approximateLength += 3;
|
|
48238
48242
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
48239
48243
|
}
|
|
48240
|
-
|
|
48244
|
+
if (!(context.flags & 536870912 /* NoTypeReduction */)) {
|
|
48245
|
+
type = getReducedType(type);
|
|
48246
|
+
}
|
|
48241
48247
|
if (type.flags & 1 /* Any */) {
|
|
48242
48248
|
if (type.aliasSymbol) {
|
|
48243
48249
|
return factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
|
|
@@ -48609,7 +48615,7 @@ function createTypeChecker(host) {
|
|
|
48609
48615
|
const typeId = type2.id;
|
|
48610
48616
|
const symbol = type2.symbol;
|
|
48611
48617
|
if (symbol) {
|
|
48612
|
-
const isInstantiationExpressionType = !!(getObjectFlags(type2) &
|
|
48618
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
48613
48619
|
if (isInstantiationExpressionType) {
|
|
48614
48620
|
const instantiationExpressionType = type2;
|
|
48615
48621
|
const existing = instantiationExpressionType.node;
|
|
@@ -48947,7 +48953,7 @@ function createTypeChecker(host) {
|
|
|
48947
48953
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
48948
48954
|
}
|
|
48949
48955
|
for (const info of resolvedType.indexInfos) {
|
|
48950
|
-
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags &
|
|
48956
|
+
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
48951
48957
|
}
|
|
48952
48958
|
const properties = resolvedType.properties;
|
|
48953
48959
|
if (!properties) {
|
|
@@ -52191,7 +52197,7 @@ function createTypeChecker(host) {
|
|
|
52191
52197
|
));
|
|
52192
52198
|
}
|
|
52193
52199
|
const result = createAnonymousType(symbol, members, emptyArray, emptyArray, getIndexInfosOfType(source));
|
|
52194
|
-
result.objectFlags |=
|
|
52200
|
+
result.objectFlags |= 4194304 /* ObjectRestType */;
|
|
52195
52201
|
return result;
|
|
52196
52202
|
}
|
|
52197
52203
|
function isGenericTypeWithUndefinedConstraint(type) {
|
|
@@ -52621,7 +52627,7 @@ function createTypeChecker(host) {
|
|
|
52621
52627
|
mergeSymbolTable(exports2, s.exports);
|
|
52622
52628
|
}
|
|
52623
52629
|
const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
|
|
52624
|
-
type.objectFlags |=
|
|
52630
|
+
type.objectFlags |= 4096 /* JSLiteral */;
|
|
52625
52631
|
return type;
|
|
52626
52632
|
}
|
|
52627
52633
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
@@ -52742,9 +52748,9 @@ function createTypeChecker(host) {
|
|
|
52742
52748
|
result.aliasTypeArguments = length(args) ? args : void 0;
|
|
52743
52749
|
}
|
|
52744
52750
|
}
|
|
52745
|
-
result.objectFlags |= getObjectFlags(type) &
|
|
52751
|
+
result.objectFlags |= getObjectFlags(type) & 4096 /* JSLiteral */;
|
|
52746
52752
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
52747
|
-
result.objectFlags |=
|
|
52753
|
+
result.objectFlags |= 16777216 /* IsClassInstanceClone */;
|
|
52748
52754
|
}
|
|
52749
52755
|
return result;
|
|
52750
52756
|
}
|
|
@@ -52797,7 +52803,7 @@ function createTypeChecker(host) {
|
|
|
52797
52803
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) {
|
|
52798
52804
|
const members = createSymbolTable();
|
|
52799
52805
|
let stringIndexInfo;
|
|
52800
|
-
let objectFlags =
|
|
52806
|
+
let objectFlags = 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
52801
52807
|
forEach(pattern.elements, (e) => {
|
|
52802
52808
|
const name = e.propertyName || e.name;
|
|
52803
52809
|
if (e.dotDotDotToken) {
|
|
@@ -52811,7 +52817,7 @@ function createTypeChecker(host) {
|
|
|
52811
52817
|
}
|
|
52812
52818
|
const exprType = getLiteralTypeFromPropertyName(name);
|
|
52813
52819
|
if (!isTypeUsableAsPropertyName(exprType)) {
|
|
52814
|
-
objectFlags |=
|
|
52820
|
+
objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */;
|
|
52815
52821
|
return;
|
|
52816
52822
|
}
|
|
52817
52823
|
const text = getPropertyNameFromType(exprType);
|
|
@@ -52832,7 +52838,7 @@ function createTypeChecker(host) {
|
|
|
52832
52838
|
result.objectFlags |= objectFlags;
|
|
52833
52839
|
if (includePatternInType) {
|
|
52834
52840
|
result.pattern = pattern;
|
|
52835
|
-
result.objectFlags |=
|
|
52841
|
+
result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */;
|
|
52836
52842
|
}
|
|
52837
52843
|
return result;
|
|
52838
52844
|
}
|
|
@@ -52850,7 +52856,7 @@ function createTypeChecker(host) {
|
|
|
52850
52856
|
if (includePatternInType) {
|
|
52851
52857
|
result = cloneTypeReference(result);
|
|
52852
52858
|
result.pattern = pattern;
|
|
52853
|
-
result.objectFlags |=
|
|
52859
|
+
result.objectFlags |= 131072 /* ContainsObjectOrArrayLiteral */;
|
|
52854
52860
|
}
|
|
52855
52861
|
return result;
|
|
52856
52862
|
}
|
|
@@ -52878,7 +52884,7 @@ function createTypeChecker(host) {
|
|
|
52878
52884
|
members.set(member.escapedName, member);
|
|
52879
52885
|
});
|
|
52880
52886
|
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
52881
|
-
type.objectFlags |=
|
|
52887
|
+
type.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* NonInferrableType */;
|
|
52882
52888
|
links.resolvedType = type;
|
|
52883
52889
|
}
|
|
52884
52890
|
return links.resolvedType;
|
|
@@ -54666,14 +54672,6 @@ function createTypeChecker(host) {
|
|
|
54666
54672
|
type.constructSignatures = constructSignatures;
|
|
54667
54673
|
}
|
|
54668
54674
|
}
|
|
54669
|
-
function resolveTypeAliasInstantiationMembers(type) {
|
|
54670
|
-
const resolved = resolveStructuredTypeMembers(getResolvedTypeAliasInstantiation(type));
|
|
54671
|
-
type.members = resolved.members;
|
|
54672
|
-
type.properties = resolved.properties;
|
|
54673
|
-
type.callSignatures = resolved.callSignatures;
|
|
54674
|
-
type.constructSignatures = resolved.constructSignatures;
|
|
54675
|
-
type.indexInfos = resolved.indexInfos;
|
|
54676
|
-
}
|
|
54677
54675
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
54678
54676
|
return instantiateType(instantiable, createTypeMapper([type.indexType, type.objectType], [getNumberLiteralType(0), createTupleType([replacement])]));
|
|
54679
54677
|
}
|
|
@@ -54940,14 +54938,12 @@ function createTypeChecker(host) {
|
|
|
54940
54938
|
resolveTypeReferenceMembers(type);
|
|
54941
54939
|
} else if (type.objectFlags & 3 /* ClassOrInterface */) {
|
|
54942
54940
|
resolveClassOrInterfaceMembers(type);
|
|
54943
|
-
} else if (type.objectFlags &
|
|
54941
|
+
} else if (type.objectFlags & 1024 /* ReverseMapped */) {
|
|
54944
54942
|
resolveReverseMappedTypeMembers(type);
|
|
54945
54943
|
} else if (type.objectFlags & 16 /* Anonymous */) {
|
|
54946
54944
|
resolveAnonymousTypeMembers(type);
|
|
54947
54945
|
} else if (type.objectFlags & 32 /* Mapped */) {
|
|
54948
54946
|
resolveMappedTypeMembers(type);
|
|
54949
|
-
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
54950
|
-
resolveTypeAliasInstantiationMembers(type);
|
|
54951
54947
|
} else {
|
|
54952
54948
|
Debug.fail("Unhandled object type " + Debug.formatObjectFlags(type.objectFlags));
|
|
54953
54949
|
}
|
|
@@ -55393,7 +55389,7 @@ function createTypeChecker(host) {
|
|
|
55393
55389
|
if (indexInfo) {
|
|
55394
55390
|
checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
|
|
55395
55391
|
indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
|
|
55396
|
-
} else if (isObjectLiteralType(type) && !(getObjectFlags(type) &
|
|
55392
|
+
} else if (isObjectLiteralType(type) && !(getObjectFlags(type) & 2097152 /* ContainsSpread */)) {
|
|
55397
55393
|
checkFlags |= 32 /* WritePartial */;
|
|
55398
55394
|
indexTypes = append(indexTypes, undefinedType);
|
|
55399
55395
|
} else {
|
|
@@ -55519,22 +55515,22 @@ function createTypeChecker(host) {
|
|
|
55519
55515
|
return property && !(getCheckFlags(property) & 16 /* ReadPartial */) ? property : void 0;
|
|
55520
55516
|
}
|
|
55521
55517
|
function getReducedType(type) {
|
|
55522
|
-
if (type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
55518
|
+
if (type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */) {
|
|
55523
55519
|
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
|
55524
55520
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
55525
|
-
if (!(type.objectFlags &
|
|
55526
|
-
type.objectFlags |=
|
|
55521
|
+
if (!(type.objectFlags & 16777216 /* IsNeverIntersectionComputed */)) {
|
|
55522
|
+
type.objectFlags |= 16777216 /* IsNeverIntersectionComputed */ | (some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 33554432 /* IsNeverIntersection */ : 0);
|
|
55527
55523
|
}
|
|
55528
|
-
return type.objectFlags &
|
|
55524
|
+
return type.objectFlags & 33554432 /* IsNeverIntersection */ ? neverType : type;
|
|
55529
55525
|
}
|
|
55530
|
-
return
|
|
55526
|
+
return type;
|
|
55531
55527
|
}
|
|
55532
55528
|
function getReducedUnionType(unionType) {
|
|
55533
55529
|
const reducedTypes = sameMap(unionType.types, getReducedType);
|
|
55534
55530
|
if (reducedTypes === unionType.types) {
|
|
55535
55531
|
return unionType;
|
|
55536
55532
|
}
|
|
55537
|
-
const reduced =
|
|
55533
|
+
const reduced = getUnionType(reducedTypes);
|
|
55538
55534
|
if (reduced.flags & 1048576 /* Union */) {
|
|
55539
55535
|
reduced.resolvedReducedType = reduced;
|
|
55540
55536
|
}
|
|
@@ -55550,14 +55546,14 @@ function createTypeChecker(host) {
|
|
|
55550
55546
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
55551
55547
|
}
|
|
55552
55548
|
function isGenericReducibleType(type) {
|
|
55553
|
-
return !!(type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
55549
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
55554
55550
|
}
|
|
55555
55551
|
function isReducibleIntersection(type) {
|
|
55556
55552
|
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
55557
55553
|
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
55558
55554
|
}
|
|
55559
55555
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
55560
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
55556
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
|
|
55561
55557
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
55562
55558
|
if (neverProp) {
|
|
55563
55559
|
return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(
|
|
@@ -56343,7 +56339,7 @@ function createTypeChecker(host) {
|
|
|
56343
56339
|
result |= getObjectFlags(type);
|
|
56344
56340
|
}
|
|
56345
56341
|
}
|
|
56346
|
-
return result &
|
|
56342
|
+
return result & 458752 /* PropagatingFlags */;
|
|
56347
56343
|
}
|
|
56348
56344
|
function tryCreateTypeReference(target, typeArguments) {
|
|
56349
56345
|
if (some(typeArguments) && target === emptyGenericType) {
|
|
@@ -56430,7 +56426,7 @@ function createTypeChecker(host) {
|
|
|
56430
56426
|
return errorType;
|
|
56431
56427
|
}
|
|
56432
56428
|
}
|
|
56433
|
-
if (node.kind === 183 /* TypeReference */ &&
|
|
56429
|
+
if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
56434
56430
|
return createDeferredTypeReference(
|
|
56435
56431
|
type,
|
|
56436
56432
|
node,
|
|
@@ -56443,6 +56439,23 @@ function createTypeChecker(host) {
|
|
|
56443
56439
|
}
|
|
56444
56440
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
56445
56441
|
}
|
|
56442
|
+
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
56443
|
+
const type = getDeclaredTypeOfSymbol(symbol);
|
|
56444
|
+
if (type === intrinsicMarkerType) {
|
|
56445
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
56446
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
56447
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
56448
|
+
}
|
|
56449
|
+
}
|
|
56450
|
+
const links = getSymbolLinks(symbol);
|
|
56451
|
+
const typeParameters = links.typeParameters;
|
|
56452
|
+
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
56453
|
+
let instantiation = links.instantiations.get(id);
|
|
56454
|
+
if (!instantiation) {
|
|
56455
|
+
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
56456
|
+
}
|
|
56457
|
+
return instantiation;
|
|
56458
|
+
}
|
|
56446
56459
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
56447
56460
|
if (getCheckFlags(symbol) & 1048576 /* Unresolved */) {
|
|
56448
56461
|
const typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
@@ -56493,13 +56506,10 @@ function createTypeChecker(host) {
|
|
|
56493
56506
|
const resolved = resolveAlias(aliasSymbol2);
|
|
56494
56507
|
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
56495
56508
|
newAliasSymbol = resolved;
|
|
56496
|
-
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node)
|
|
56509
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) || (typeParameters ? [] : void 0);
|
|
56497
56510
|
}
|
|
56498
56511
|
}
|
|
56499
56512
|
}
|
|
56500
|
-
if (getObjectFlags(type) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */) && node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
56501
|
-
return createDeferredTypeAliasInstantiation(symbol, node, newAliasSymbol, aliasTypeArguments);
|
|
56502
|
-
}
|
|
56503
56513
|
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
|
|
56504
56514
|
}
|
|
56505
56515
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
@@ -56509,43 +56519,6 @@ function createTypeChecker(host) {
|
|
|
56509
56519
|
const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias);
|
|
56510
56520
|
return !!(declaration && getContainingFunction(declaration));
|
|
56511
56521
|
}
|
|
56512
|
-
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
56513
|
-
const type = getDeclaredTypeOfSymbol(symbol);
|
|
56514
|
-
if (type === intrinsicMarkerType) {
|
|
56515
|
-
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
56516
|
-
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
56517
|
-
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
56518
|
-
}
|
|
56519
|
-
}
|
|
56520
|
-
const links = getSymbolLinks(symbol);
|
|
56521
|
-
const typeParameters = links.typeParameters;
|
|
56522
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
56523
|
-
let instantiation = links.instantiations.get(id);
|
|
56524
|
-
if (!instantiation) {
|
|
56525
|
-
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
56526
|
-
}
|
|
56527
|
-
return instantiation;
|
|
56528
|
-
}
|
|
56529
|
-
function createDeferredTypeAliasInstantiation(typeAlias, node, aliasSymbol, aliasTypeArguments) {
|
|
56530
|
-
const type = getDeclaredTypeOfSymbol(typeAlias);
|
|
56531
|
-
const result = createObjectType(64 /* TypeAliasInstantiation */, type.symbol);
|
|
56532
|
-
result.typeAlias = typeAlias;
|
|
56533
|
-
result.node = node;
|
|
56534
|
-
result.aliasSymbol = aliasSymbol;
|
|
56535
|
-
result.aliasTypeArguments = aliasTypeArguments;
|
|
56536
|
-
return result;
|
|
56537
|
-
}
|
|
56538
|
-
function getResolvedType(type) {
|
|
56539
|
-
return type.flags & 524288 /* Object */ && type.objectFlags & 64 /* TypeAliasInstantiation */ ? getResolvedTypeAliasInstantiation(type) : type;
|
|
56540
|
-
}
|
|
56541
|
-
function getResolvedTypeAliasInstantiation(type) {
|
|
56542
|
-
if (!type.resolvedType) {
|
|
56543
|
-
const typeArguments = typeArgumentsFromTypeReferenceNode(type.node);
|
|
56544
|
-
const mappedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
|
|
56545
|
-
type.resolvedType = getTypeAliasInstantiation(type.typeAlias, mappedTypeArguments, type.aliasSymbol, type.aliasTypeArguments);
|
|
56546
|
-
}
|
|
56547
|
-
return type.resolvedType;
|
|
56548
|
-
}
|
|
56549
56522
|
function getTypeReferenceName(node) {
|
|
56550
56523
|
switch (node.kind) {
|
|
56551
56524
|
case 183 /* TypeReference */:
|
|
@@ -57237,7 +57210,7 @@ function createTypeChecker(host) {
|
|
|
57237
57210
|
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
57238
57211
|
}
|
|
57239
57212
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
57240
|
-
return isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
57213
|
+
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));
|
|
57241
57214
|
}
|
|
57242
57215
|
function isResolvedByTypeAlias(node) {
|
|
57243
57216
|
const parent = node.parent;
|
|
@@ -57292,7 +57265,7 @@ function createTypeChecker(host) {
|
|
|
57292
57265
|
const target = getArrayOrTupleTargetType(node);
|
|
57293
57266
|
if (target === emptyGenericType) {
|
|
57294
57267
|
links.resolvedType = emptyObjectType;
|
|
57295
|
-
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) &&
|
|
57268
|
+
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
|
|
57296
57269
|
links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(
|
|
57297
57270
|
target,
|
|
57298
57271
|
node,
|
|
@@ -57512,12 +57485,12 @@ function createTypeChecker(host) {
|
|
|
57512
57485
|
includes |= flags & 473694207 /* IncludesMask */;
|
|
57513
57486
|
if (flags & 465829888 /* Instantiable */)
|
|
57514
57487
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
57515
|
-
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57488
|
+
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */)
|
|
57516
57489
|
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
57517
57490
|
if (type === wildcardType)
|
|
57518
57491
|
includes |= 8388608 /* IncludesWildcard */;
|
|
57519
57492
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
57520
|
-
if (!(getObjectFlags(type) &
|
|
57493
|
+
if (!(getObjectFlags(type) & 65536 /* ContainsWideningType */))
|
|
57521
57494
|
includes |= 4194304 /* IncludesNonWideningType */;
|
|
57522
57495
|
} else {
|
|
57523
57496
|
const len = typeSet.length;
|
|
@@ -57624,7 +57597,7 @@ function createTypeChecker(host) {
|
|
|
57624
57597
|
function removeConstrainedTypeVariables(types) {
|
|
57625
57598
|
const typeVariables = [];
|
|
57626
57599
|
for (const type of types) {
|
|
57627
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57600
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57628
57601
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57629
57602
|
pushIfUnique(typeVariables, type.types[index]);
|
|
57630
57603
|
}
|
|
@@ -57632,7 +57605,7 @@ function createTypeChecker(host) {
|
|
|
57632
57605
|
for (const typeVariable of typeVariables) {
|
|
57633
57606
|
const primitives = [];
|
|
57634
57607
|
for (const type of types) {
|
|
57635
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57608
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57636
57609
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57637
57610
|
if (type.types[index] === typeVariable) {
|
|
57638
57611
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -57645,7 +57618,7 @@ function createTypeChecker(host) {
|
|
|
57645
57618
|
while (i > 0) {
|
|
57646
57619
|
i--;
|
|
57647
57620
|
const type = types[i];
|
|
57648
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57621
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57649
57622
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57650
57623
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
57651
57624
|
orderedRemoveItemAt(types, i);
|
|
@@ -57754,7 +57727,7 @@ function createTypeChecker(host) {
|
|
|
57754
57727
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
57755
57728
|
}
|
|
57756
57729
|
}
|
|
57757
|
-
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 :
|
|
57730
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
|
|
57758
57731
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
57759
57732
|
}
|
|
57760
57733
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -57905,14 +57878,14 @@ function createTypeChecker(host) {
|
|
|
57905
57878
|
}
|
|
57906
57879
|
function intersectUnionsOfPrimitiveTypes(types) {
|
|
57907
57880
|
let unionTypes2;
|
|
57908
|
-
const index = findIndex(types, (t) => !!(getObjectFlags(t) &
|
|
57881
|
+
const index = findIndex(types, (t) => !!(getObjectFlags(t) & 32768 /* PrimitiveUnion */));
|
|
57909
57882
|
if (index < 0) {
|
|
57910
57883
|
return false;
|
|
57911
57884
|
}
|
|
57912
57885
|
let i = index + 1;
|
|
57913
57886
|
while (i < types.length) {
|
|
57914
57887
|
const t = types[i];
|
|
57915
|
-
if (getObjectFlags(t) &
|
|
57888
|
+
if (getObjectFlags(t) & 32768 /* PrimitiveUnion */) {
|
|
57916
57889
|
(unionTypes2 || (unionTypes2 = [types[index]])).push(t);
|
|
57917
57890
|
orderedRemoveItemAt(types, i);
|
|
57918
57891
|
} else {
|
|
@@ -57933,7 +57906,7 @@ function createTypeChecker(host) {
|
|
|
57933
57906
|
}
|
|
57934
57907
|
}
|
|
57935
57908
|
}
|
|
57936
|
-
types[index] = getUnionTypeFromSortedList(result,
|
|
57909
|
+
types[index] = getUnionTypeFromSortedList(result, 32768 /* PrimitiveUnion */);
|
|
57937
57910
|
return true;
|
|
57938
57911
|
}
|
|
57939
57912
|
function createIntersectionType(types, objectFlags, aliasSymbol, aliasTypeArguments) {
|
|
@@ -57996,7 +57969,7 @@ function createTypeChecker(host) {
|
|
|
57996
57969
|
return neverType;
|
|
57997
57970
|
}
|
|
57998
57971
|
}
|
|
57999
|
-
objectFlags =
|
|
57972
|
+
objectFlags = 67108864 /* IsConstrainedTypeVariable */;
|
|
58000
57973
|
}
|
|
58001
57974
|
}
|
|
58002
57975
|
}
|
|
@@ -58349,7 +58322,7 @@ function createTypeChecker(host) {
|
|
|
58349
58322
|
if (noImplicitAny) {
|
|
58350
58323
|
return false;
|
|
58351
58324
|
}
|
|
58352
|
-
if (getObjectFlags(type) &
|
|
58325
|
+
if (getObjectFlags(type) & 4096 /* JSLiteral */) {
|
|
58353
58326
|
return true;
|
|
58354
58327
|
}
|
|
58355
58328
|
if (type.flags & 1048576 /* Union */) {
|
|
@@ -58597,28 +58570,28 @@ function createTypeChecker(host) {
|
|
|
58597
58570
|
return !!getGenericObjectFlags(type);
|
|
58598
58571
|
}
|
|
58599
58572
|
function isGenericObjectType(type) {
|
|
58600
|
-
return !!(getGenericObjectFlags(type) &
|
|
58573
|
+
return !!(getGenericObjectFlags(type) & 4194304 /* IsGenericObjectType */);
|
|
58601
58574
|
}
|
|
58602
58575
|
function isGenericIndexType(type) {
|
|
58603
|
-
return !!(getGenericObjectFlags(type) &
|
|
58576
|
+
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
58604
58577
|
}
|
|
58605
58578
|
function getGenericObjectFlags(type) {
|
|
58606
58579
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
58607
|
-
if (!(type.objectFlags &
|
|
58608
|
-
type.objectFlags |=
|
|
58580
|
+
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
58581
|
+
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
58609
58582
|
}
|
|
58610
|
-
return type.objectFlags &
|
|
58583
|
+
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
58611
58584
|
}
|
|
58612
58585
|
if (type.flags & 33554432 /* Substitution */) {
|
|
58613
|
-
if (!(type.objectFlags &
|
|
58614
|
-
type.objectFlags |=
|
|
58586
|
+
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
58587
|
+
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | getGenericObjectFlags(type.baseType) | getGenericObjectFlags(type.constraint);
|
|
58615
58588
|
}
|
|
58616
|
-
return type.objectFlags &
|
|
58589
|
+
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
58617
58590
|
}
|
|
58618
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(
|
|
58591
|
+
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);
|
|
58619
58592
|
}
|
|
58620
58593
|
function getSimplifiedType(type, writing) {
|
|
58621
|
-
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) :
|
|
58594
|
+
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
58622
58595
|
}
|
|
58623
58596
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
58624
58597
|
if (objectType.flags & 1048576 /* Union */ || objectType.flags & 2097152 /* Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
@@ -59118,7 +59091,7 @@ function createTypeChecker(host) {
|
|
|
59118
59091
|
}
|
|
59119
59092
|
}
|
|
59120
59093
|
const spread = createAnonymousType(type2.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type2));
|
|
59121
|
-
spread.objectFlags |=
|
|
59094
|
+
spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
59122
59095
|
return spread;
|
|
59123
59096
|
}
|
|
59124
59097
|
}
|
|
@@ -59195,7 +59168,7 @@ function createTypeChecker(host) {
|
|
|
59195
59168
|
}
|
|
59196
59169
|
}
|
|
59197
59170
|
const spread = createAnonymousType(symbol, members, emptyArray, emptyArray, sameMap(indexInfos, (info) => getIndexInfoWithReadonly(info, readonly)));
|
|
59198
|
-
spread.objectFlags |=
|
|
59171
|
+
spread.objectFlags |= 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */ | 2097152 /* ContainsSpread */ | objectFlags;
|
|
59199
59172
|
return spread;
|
|
59200
59173
|
}
|
|
59201
59174
|
function isSpreadableProperty(prop) {
|
|
@@ -59616,9 +59589,9 @@ function createTypeChecker(host) {
|
|
|
59616
59589
|
return result;
|
|
59617
59590
|
}
|
|
59618
59591
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
59619
|
-
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags &
|
|
59592
|
+
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0];
|
|
59620
59593
|
const links = getNodeLinks(declaration);
|
|
59621
|
-
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags &
|
|
59594
|
+
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
59622
59595
|
let typeParameters = links.outerTypeParameters;
|
|
59623
59596
|
if (!typeParameters) {
|
|
59624
59597
|
let outerTypeParameters = getOuterTypeParameters(
|
|
@@ -59631,8 +59604,8 @@ function createTypeChecker(host) {
|
|
|
59631
59604
|
outerTypeParameters = addRange(outerTypeParameters, templateTagParameters);
|
|
59632
59605
|
}
|
|
59633
59606
|
typeParameters = outerTypeParameters || emptyArray;
|
|
59634
|
-
const allDeclarations = type.objectFlags & (4 /* Reference */ |
|
|
59635
|
-
typeParameters = (target.objectFlags & (4 /* Reference */ |
|
|
59607
|
+
const allDeclarations = type.objectFlags & (4 /* Reference */ | 8388608 /* InstantiationExpressionType */) ? [declaration] : type.symbol.declarations;
|
|
59608
|
+
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;
|
|
59636
59609
|
links.outerTypeParameters = typeParameters;
|
|
59637
59610
|
}
|
|
59638
59611
|
if (typeParameters.length) {
|
|
@@ -59651,13 +59624,13 @@ function createTypeChecker(host) {
|
|
|
59651
59624
|
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);
|
|
59652
59625
|
target.instantiations.set(id, result);
|
|
59653
59626
|
const resultObjectFlags = getObjectFlags(result);
|
|
59654
|
-
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags &
|
|
59627
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
59655
59628
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
59656
|
-
if (!(getObjectFlags(result) &
|
|
59629
|
+
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
59657
59630
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
59658
|
-
result.objectFlags |=
|
|
59631
|
+
result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
59659
59632
|
} else {
|
|
59660
|
-
result.objectFlags |= !resultCouldContainTypeVariables ?
|
|
59633
|
+
result.objectFlags |= !resultCouldContainTypeVariables ? 524288 /* CouldContainTypeVariablesComputed */ : 0;
|
|
59661
59634
|
}
|
|
59662
59635
|
}
|
|
59663
59636
|
}
|
|
@@ -59787,7 +59760,8 @@ function createTypeChecker(host) {
|
|
|
59787
59760
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
59788
59761
|
}
|
|
59789
59762
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
59790
|
-
|
|
59763
|
+
Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
|
|
59764
|
+
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
59791
59765
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
59792
59766
|
result.declaration = type.declaration;
|
|
59793
59767
|
const origTypeParameter = getTypeParameterFromMappedType(type);
|
|
@@ -59795,10 +59769,8 @@ function createTypeChecker(host) {
|
|
|
59795
59769
|
result.typeParameter = freshTypeParameter;
|
|
59796
59770
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
59797
59771
|
freshTypeParameter.mapper = mapper;
|
|
59798
|
-
}
|
|
59799
|
-
|
|
59800
|
-
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
59801
|
-
result.typeAlias = type.typeAlias;
|
|
59772
|
+
}
|
|
59773
|
+
if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
|
|
59802
59774
|
result.node = type.node;
|
|
59803
59775
|
}
|
|
59804
59776
|
result.target = type;
|
|
@@ -59817,8 +59789,8 @@ function createTypeChecker(host) {
|
|
|
59817
59789
|
if (!result) {
|
|
59818
59790
|
const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
|
|
59819
59791
|
const checkType = root.checkType;
|
|
59820
|
-
const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
|
|
59821
|
-
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(
|
|
59792
|
+
const distributionType = root.isDistributive ? getReducedType(getMappedType(checkType, newMapper)) : void 0;
|
|
59793
|
+
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);
|
|
59822
59794
|
root.instantiations.set(id, result);
|
|
59823
59795
|
}
|
|
59824
59796
|
return result;
|
|
@@ -59859,13 +59831,13 @@ function createTypeChecker(host) {
|
|
|
59859
59831
|
}
|
|
59860
59832
|
if (flags & 524288 /* Object */) {
|
|
59861
59833
|
const objectFlags = type.objectFlags;
|
|
59862
|
-
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */
|
|
59834
|
+
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */)) {
|
|
59863
59835
|
if (objectFlags & 4 /* Reference */ && !type.node) {
|
|
59864
59836
|
const resolvedTypeArguments = type.resolvedTypeArguments;
|
|
59865
59837
|
const newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper);
|
|
59866
59838
|
return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type;
|
|
59867
59839
|
}
|
|
59868
|
-
if (objectFlags &
|
|
59840
|
+
if (objectFlags & 1024 /* ReverseMapped */) {
|
|
59869
59841
|
return instantiateReverseMappedType(type, mapper);
|
|
59870
59842
|
}
|
|
59871
59843
|
return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments);
|
|
@@ -60801,11 +60773,11 @@ function createTypeChecker(host) {
|
|
|
60801
60773
|
}
|
|
60802
60774
|
function isUnknownLikeUnionType(type) {
|
|
60803
60775
|
if (strictNullChecks && type.flags & 1048576 /* Union */) {
|
|
60804
|
-
if (!(type.objectFlags &
|
|
60776
|
+
if (!(type.objectFlags & 33554432 /* IsUnknownLikeUnionComputed */)) {
|
|
60805
60777
|
const types = type.types;
|
|
60806
|
-
type.objectFlags |=
|
|
60778
|
+
type.objectFlags |= 33554432 /* IsUnknownLikeUnionComputed */ | (types.length >= 3 && types[0].flags & 32768 /* Undefined */ && types[1].flags & 65536 /* Null */ && some(types, isEmptyAnonymousObjectType) ? 67108864 /* IsUnknownLikeUnion */ : 0);
|
|
60807
60779
|
}
|
|
60808
|
-
return !!(type.objectFlags &
|
|
60780
|
+
return !!(type.objectFlags & 67108864 /* IsUnknownLikeUnion */);
|
|
60809
60781
|
}
|
|
60810
60782
|
return false;
|
|
60811
60783
|
}
|
|
@@ -60916,7 +60888,7 @@ function createTypeChecker(host) {
|
|
|
60916
60888
|
return true;
|
|
60917
60889
|
if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */))
|
|
60918
60890
|
return true;
|
|
60919
|
-
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) &
|
|
60891
|
+
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) & 8192 /* FreshLiteral */)))
|
|
60920
60892
|
return true;
|
|
60921
60893
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
60922
60894
|
if (s & 1 /* Any */)
|
|
@@ -60975,11 +60947,11 @@ function createTypeChecker(host) {
|
|
|
60975
60947
|
return false;
|
|
60976
60948
|
}
|
|
60977
60949
|
function isIgnoredJsxProperty(source, sourceProp) {
|
|
60978
|
-
return getObjectFlags(source) &
|
|
60950
|
+
return getObjectFlags(source) & 2048 /* JsxAttributes */ && isHyphenatedJsxName(sourceProp.escapedName);
|
|
60979
60951
|
}
|
|
60980
60952
|
function getNormalizedType(type, writing) {
|
|
60981
60953
|
while (true) {
|
|
60982
|
-
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 :
|
|
60954
|
+
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;
|
|
60983
60955
|
if (t === type)
|
|
60984
60956
|
return t;
|
|
60985
60957
|
type = t;
|
|
@@ -61369,7 +61341,7 @@ function createTypeChecker(host) {
|
|
|
61369
61341
|
if (relation === comparableRelation && !(target2.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0))
|
|
61370
61342
|
return -1 /* True */;
|
|
61371
61343
|
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
61372
|
-
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source2) && getObjectFlags(source2) &
|
|
61344
|
+
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */);
|
|
61373
61345
|
if (isPerformingExcessPropertyChecks) {
|
|
61374
61346
|
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
61375
61347
|
if (reportErrors2) {
|
|
@@ -61379,7 +61351,7 @@ function createTypeChecker(host) {
|
|
|
61379
61351
|
}
|
|
61380
61352
|
}
|
|
61381
61353
|
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));
|
|
61382
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
61354
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */);
|
|
61383
61355
|
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) {
|
|
61384
61356
|
if (reportErrors2) {
|
|
61385
61357
|
const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2);
|
|
@@ -61444,7 +61416,7 @@ function createTypeChecker(host) {
|
|
|
61444
61416
|
tryElaborateErrorsForPrimitivesAndObjects(source2, target2);
|
|
61445
61417
|
} else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) {
|
|
61446
61418
|
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
61447
|
-
} else if (getObjectFlags(source2) &
|
|
61419
|
+
} else if (getObjectFlags(source2) & 2048 /* JsxAttributes */ && target2.flags & 2097152 /* Intersection */) {
|
|
61448
61420
|
const targetTypes = target2.types;
|
|
61449
61421
|
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
61450
61422
|
const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
@@ -61475,7 +61447,7 @@ function createTypeChecker(host) {
|
|
|
61475
61447
|
if (source2.flags & 3145728 /* UnionOrIntersection */ && target2.flags & 3145728 /* UnionOrIntersection */) {
|
|
61476
61448
|
const sourceUnionOrIntersection = source2;
|
|
61477
61449
|
const targetUnionOrIntersection = target2;
|
|
61478
|
-
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags &
|
|
61450
|
+
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 32768 /* PrimitiveUnion */) {
|
|
61479
61451
|
return;
|
|
61480
61452
|
}
|
|
61481
61453
|
const sourceSize = sourceUnionOrIntersection.types.length;
|
|
@@ -61509,10 +61481,10 @@ function createTypeChecker(host) {
|
|
|
61509
61481
|
}
|
|
61510
61482
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
61511
61483
|
var _a2;
|
|
61512
|
-
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) &
|
|
61484
|
+
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 4096 /* JSLiteral */) {
|
|
61513
61485
|
return false;
|
|
61514
61486
|
}
|
|
61515
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
61487
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048 /* JsxAttributes */);
|
|
61516
61488
|
if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) {
|
|
61517
61489
|
return false;
|
|
61518
61490
|
}
|
|
@@ -61651,7 +61623,7 @@ function createTypeChecker(host) {
|
|
|
61651
61623
|
if (containsType(targetTypes, source2)) {
|
|
61652
61624
|
return -1 /* True */;
|
|
61653
61625
|
}
|
|
61654
|
-
if (relation !== comparableRelation && getObjectFlags(target2) &
|
|
61626
|
+
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 */)) {
|
|
61655
61627
|
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
61656
61628
|
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
61657
61629
|
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
@@ -62055,7 +62027,7 @@ function createTypeChecker(host) {
|
|
|
62055
62027
|
false,
|
|
62056
62028
|
0 /* None */
|
|
62057
62029
|
);
|
|
62058
|
-
if (result2 && isObjectLiteralType(source2) && getObjectFlags(source2) &
|
|
62030
|
+
if (result2 && isObjectLiteralType(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */) {
|
|
62059
62031
|
result2 &= indexSignaturesRelatedTo(
|
|
62060
62032
|
source2,
|
|
62061
62033
|
target2,
|
|
@@ -62065,7 +62037,7 @@ function createTypeChecker(host) {
|
|
|
62065
62037
|
0 /* None */
|
|
62066
62038
|
);
|
|
62067
62039
|
}
|
|
62068
|
-
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) &
|
|
62040
|
+
} 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 */))) {
|
|
62069
62041
|
result2 &= propertiesRelatedTo(
|
|
62070
62042
|
source2,
|
|
62071
62043
|
target2,
|
|
@@ -62566,7 +62538,7 @@ function createTypeChecker(host) {
|
|
|
62566
62538
|
if (constraint !== source2) {
|
|
62567
62539
|
return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2);
|
|
62568
62540
|
}
|
|
62569
|
-
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) &
|
|
62541
|
+
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 8192 /* FreshLiteral */ && !isEmptyObjectType(source2)) {
|
|
62570
62542
|
return 0 /* False */;
|
|
62571
62543
|
}
|
|
62572
62544
|
if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
|
|
@@ -63098,7 +63070,7 @@ function createTypeChecker(host) {
|
|
|
63098
63070
|
const incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
63099
63071
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
63100
63072
|
const targetObjectFlags = getObjectFlags(target2);
|
|
63101
|
-
if (sourceObjectFlags &
|
|
63073
|
+
if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
63102
63074
|
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
63103
63075
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
63104
63076
|
const related = signatureRelatedTo(
|
|
@@ -63314,7 +63286,7 @@ function createTypeChecker(host) {
|
|
|
63314
63286
|
if (sourceInfo) {
|
|
63315
63287
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
63316
63288
|
}
|
|
63317
|
-
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) &
|
|
63289
|
+
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 8192 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) {
|
|
63318
63290
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
63319
63291
|
}
|
|
63320
63292
|
if (reportErrors2) {
|
|
@@ -63588,11 +63560,11 @@ function createTypeChecker(host) {
|
|
|
63588
63560
|
}
|
|
63589
63561
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
63590
63562
|
if (depth >= maxDepth) {
|
|
63591
|
-
if ((getObjectFlags(type) &
|
|
63563
|
+
if ((getObjectFlags(type) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */) {
|
|
63592
63564
|
type = getMappedTargetWithSymbol(type);
|
|
63593
63565
|
}
|
|
63594
63566
|
if (type.flags & 2097152 /* Intersection */) {
|
|
63595
|
-
return some(type.types, (t) => isDeeplyNestedType(
|
|
63567
|
+
return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth));
|
|
63596
63568
|
}
|
|
63597
63569
|
const identity2 = getRecursionIdentity(type);
|
|
63598
63570
|
let count = 0;
|
|
@@ -63614,17 +63586,17 @@ function createTypeChecker(host) {
|
|
|
63614
63586
|
}
|
|
63615
63587
|
function getMappedTargetWithSymbol(type) {
|
|
63616
63588
|
let target;
|
|
63617
|
-
while ((getObjectFlags(type) &
|
|
63589
|
+
while ((getObjectFlags(type) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */ && (target = getModifiersTypeFromMappedType(type)) && (target.symbol || target.flags & 2097152 /* Intersection */ && some(target.types, (t) => !!t.symbol))) {
|
|
63618
63590
|
type = target;
|
|
63619
63591
|
}
|
|
63620
63592
|
return type;
|
|
63621
63593
|
}
|
|
63622
63594
|
function hasMatchingRecursionIdentity(type, identity2) {
|
|
63623
|
-
if ((getObjectFlags(type) &
|
|
63595
|
+
if ((getObjectFlags(type) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */) {
|
|
63624
63596
|
type = getMappedTargetWithSymbol(type);
|
|
63625
63597
|
}
|
|
63626
63598
|
if (type.flags & 2097152 /* Intersection */) {
|
|
63627
|
-
return some(type.types, (t) => hasMatchingRecursionIdentity(
|
|
63599
|
+
return some(type.types, (t) => hasMatchingRecursionIdentity(t, identity2));
|
|
63628
63600
|
}
|
|
63629
63601
|
return getRecursionIdentity(type) === identity2;
|
|
63630
63602
|
}
|
|
@@ -63807,10 +63779,10 @@ function createTypeChecker(host) {
|
|
|
63807
63779
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
63808
63780
|
return void 0;
|
|
63809
63781
|
}
|
|
63810
|
-
if (getObjectFlags(type) &
|
|
63811
|
-
return getObjectFlags(type) &
|
|
63782
|
+
if (getObjectFlags(type) & 33554432 /* IdenticalBaseTypeCalculated */) {
|
|
63783
|
+
return getObjectFlags(type) & 67108864 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : void 0;
|
|
63812
63784
|
}
|
|
63813
|
-
type.objectFlags |=
|
|
63785
|
+
type.objectFlags |= 33554432 /* IdenticalBaseTypeCalculated */;
|
|
63814
63786
|
const target = type.target;
|
|
63815
63787
|
if (getObjectFlags(target) & 1 /* Class */) {
|
|
63816
63788
|
const baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -63829,7 +63801,7 @@ function createTypeChecker(host) {
|
|
|
63829
63801
|
if (length(getTypeArguments(type)) > length(target.typeParameters)) {
|
|
63830
63802
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, last(getTypeArguments(type)));
|
|
63831
63803
|
}
|
|
63832
|
-
type.objectFlags |=
|
|
63804
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeExists */;
|
|
63833
63805
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
63834
63806
|
}
|
|
63835
63807
|
function isEmptyLiteralType(type) {
|
|
@@ -64014,7 +63986,7 @@ function createTypeChecker(host) {
|
|
|
64014
63986
|
}
|
|
64015
63987
|
function isObjectTypeWithInferableIndex(type) {
|
|
64016
63988
|
const objectFlags = getObjectFlags(type);
|
|
64017
|
-
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 &
|
|
63989
|
+
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));
|
|
64018
63990
|
}
|
|
64019
63991
|
function createSymbolWithType(source, type) {
|
|
64020
63992
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
@@ -64041,7 +64013,7 @@ function createTypeChecker(host) {
|
|
|
64041
64013
|
return members;
|
|
64042
64014
|
}
|
|
64043
64015
|
function getRegularTypeOfObjectLiteral(type) {
|
|
64044
|
-
if (!(isObjectLiteralType(type) && getObjectFlags(type) &
|
|
64016
|
+
if (!(isObjectLiteralType(type) && getObjectFlags(type) & 8192 /* FreshLiteral */)) {
|
|
64045
64017
|
return type;
|
|
64046
64018
|
}
|
|
64047
64019
|
const regularType = type.regularType;
|
|
@@ -64052,7 +64024,7 @@ function createTypeChecker(host) {
|
|
|
64052
64024
|
const members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
|
64053
64025
|
const regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
|
|
64054
64026
|
regularNew.flags = resolved.flags;
|
|
64055
|
-
regularNew.objectFlags |= resolved.objectFlags & ~
|
|
64027
|
+
regularNew.objectFlags |= resolved.objectFlags & ~8192 /* FreshLiteral */;
|
|
64056
64028
|
type.regularType = regularNew;
|
|
64057
64029
|
return regularNew;
|
|
64058
64030
|
}
|
|
@@ -64080,7 +64052,7 @@ function createTypeChecker(host) {
|
|
|
64080
64052
|
if (!context.resolvedProperties) {
|
|
64081
64053
|
const names = /* @__PURE__ */ new Map();
|
|
64082
64054
|
for (const t of getSiblingsOfContext(context)) {
|
|
64083
|
-
if (isObjectLiteralType(t) && !(getObjectFlags(t) &
|
|
64055
|
+
if (isObjectLiteralType(t) && !(getObjectFlags(t) & 2097152 /* ContainsSpread */)) {
|
|
64084
64056
|
for (const prop of getPropertiesOfType(t)) {
|
|
64085
64057
|
names.set(prop.escapedName, prop);
|
|
64086
64058
|
}
|
|
@@ -64127,7 +64099,7 @@ function createTypeChecker(host) {
|
|
|
64127
64099
|
}
|
|
64128
64100
|
}
|
|
64129
64101
|
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
64130
|
-
result.objectFlags |= getObjectFlags(type) & (
|
|
64102
|
+
result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
|
|
64131
64103
|
return result;
|
|
64132
64104
|
}
|
|
64133
64105
|
function getWidenedType(type) {
|
|
@@ -64138,7 +64110,7 @@ function createTypeChecker(host) {
|
|
|
64138
64110
|
);
|
|
64139
64111
|
}
|
|
64140
64112
|
function getWidenedTypeWithContext(type, context) {
|
|
64141
|
-
if (getObjectFlags(type) &
|
|
64113
|
+
if (getObjectFlags(type) & 196608 /* RequiresWidening */) {
|
|
64142
64114
|
if (context === void 0 && type.widened) {
|
|
64143
64115
|
return type.widened;
|
|
64144
64116
|
}
|
|
@@ -64171,7 +64143,7 @@ function createTypeChecker(host) {
|
|
|
64171
64143
|
}
|
|
64172
64144
|
function reportWideningErrorsInType(type) {
|
|
64173
64145
|
let errorReported = false;
|
|
64174
|
-
if (getObjectFlags(type) &
|
|
64146
|
+
if (getObjectFlags(type) & 65536 /* ContainsWideningType */) {
|
|
64175
64147
|
if (type.flags & 1048576 /* Union */) {
|
|
64176
64148
|
if (some(type.types, isEmptyObjectType)) {
|
|
64177
64149
|
errorReported = true;
|
|
@@ -64193,7 +64165,7 @@ function createTypeChecker(host) {
|
|
|
64193
64165
|
if (isObjectLiteralType(type)) {
|
|
64194
64166
|
for (const p of getPropertiesOfObjectType(type)) {
|
|
64195
64167
|
const t = getTypeOfSymbol(p);
|
|
64196
|
-
if (getObjectFlags(t) &
|
|
64168
|
+
if (getObjectFlags(t) & 65536 /* ContainsWideningType */) {
|
|
64197
64169
|
if (!reportWideningErrorsInType(t)) {
|
|
64198
64170
|
error(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
|
|
64199
64171
|
}
|
|
@@ -64281,7 +64253,7 @@ function createTypeChecker(host) {
|
|
|
64281
64253
|
}
|
|
64282
64254
|
function reportErrorsFromWidening(declaration, type, wideningKind) {
|
|
64283
64255
|
addLazyDiagnostic(() => {
|
|
64284
|
-
if (noImplicitAny && getObjectFlags(type) &
|
|
64256
|
+
if (noImplicitAny && getObjectFlags(type) & 65536 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
64285
64257
|
if (!reportWideningErrorsInType(type)) {
|
|
64286
64258
|
reportImplicitAny(declaration, type, wideningKind);
|
|
64287
64259
|
}
|
|
@@ -64418,12 +64390,12 @@ function createTypeChecker(host) {
|
|
|
64418
64390
|
}
|
|
64419
64391
|
function couldContainTypeVariables(type) {
|
|
64420
64392
|
const objectFlags = getObjectFlags(type);
|
|
64421
|
-
if (objectFlags &
|
|
64422
|
-
return !!(objectFlags &
|
|
64393
|
+
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
64394
|
+
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
64423
64395
|
}
|
|
64424
|
-
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 */ |
|
|
64396
|
+
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));
|
|
64425
64397
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
64426
|
-
type.objectFlags |=
|
|
64398
|
+
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
64427
64399
|
}
|
|
64428
64400
|
return result;
|
|
64429
64401
|
}
|
|
@@ -64487,7 +64459,7 @@ function createTypeChecker(host) {
|
|
|
64487
64459
|
return type;
|
|
64488
64460
|
}
|
|
64489
64461
|
function isPartiallyInferableType(type) {
|
|
64490
|
-
return !(getObjectFlags(type) &
|
|
64462
|
+
return !(getObjectFlags(type) & 262144 /* NonInferrableType */) || isObjectLiteralType(type) && some(getPropertiesOfType(type), (prop) => isPartiallyInferableType(getTypeOfSymbol(prop))) || isTupleType(type) && some(getElementTypes(type), isPartiallyInferableType);
|
|
64491
64463
|
}
|
|
64492
64464
|
function createReverseMappedType(source, target, constraint) {
|
|
64493
64465
|
if (!(getIndexInfoOfType(source, stringType) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {
|
|
@@ -64502,7 +64474,7 @@ function createTypeChecker(host) {
|
|
|
64502
64474
|
return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations);
|
|
64503
64475
|
}
|
|
64504
64476
|
const reversed = createObjectType(
|
|
64505
|
-
|
|
64477
|
+
1024 /* ReverseMapped */ | 16 /* Anonymous */,
|
|
64506
64478
|
/*symbol*/
|
|
64507
64479
|
void 0
|
|
64508
64480
|
);
|
|
@@ -64723,8 +64695,6 @@ function createTypeChecker(host) {
|
|
|
64723
64695
|
propagationType = savePropagationType;
|
|
64724
64696
|
return;
|
|
64725
64697
|
}
|
|
64726
|
-
source = getResolvedType(source);
|
|
64727
|
-
target = getResolvedType(target);
|
|
64728
64698
|
if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
|
|
64729
64699
|
if (source.aliasTypeArguments) {
|
|
64730
64700
|
const params = getSymbolLinks(source.aliasSymbol).typeParameters;
|
|
@@ -64775,7 +64745,7 @@ function createTypeChecker(host) {
|
|
|
64775
64745
|
}
|
|
64776
64746
|
const inference = getInferenceInfoForType(target);
|
|
64777
64747
|
if (inference) {
|
|
64778
|
-
if (getObjectFlags(source) &
|
|
64748
|
+
if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
64779
64749
|
return;
|
|
64780
64750
|
}
|
|
64781
64751
|
if (!inference.isFixed) {
|
|
@@ -65059,7 +65029,7 @@ function createTypeChecker(host) {
|
|
|
65059
65029
|
inferWithPriority(
|
|
65060
65030
|
inferredType,
|
|
65061
65031
|
inference.typeParameter,
|
|
65062
|
-
getObjectFlags(source) &
|
|
65032
|
+
getObjectFlags(source) & 262144 /* NonInferrableType */ ? 16 /* PartialHomomorphicMappedType */ : 8 /* HomomorphicMappedType */
|
|
65063
65033
|
);
|
|
65064
65034
|
}
|
|
65065
65035
|
}
|
|
@@ -65314,10 +65284,10 @@ function createTypeChecker(host) {
|
|
|
65314
65284
|
return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 402784252 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
|
|
65315
65285
|
}
|
|
65316
65286
|
function isObjectLiteralType(type) {
|
|
65317
|
-
return !!(getObjectFlags(type) &
|
|
65287
|
+
return !!(getObjectFlags(type) & 128 /* ObjectLiteral */);
|
|
65318
65288
|
}
|
|
65319
65289
|
function isObjectOrArrayLiteralType(type) {
|
|
65320
|
-
return !!(getObjectFlags(type) & (
|
|
65290
|
+
return !!(getObjectFlags(type) & (128 /* ObjectLiteral */ | 16384 /* ArrayLiteral */));
|
|
65321
65291
|
}
|
|
65322
65292
|
function unionObjectAndArrayLiteralCandidates(candidates) {
|
|
65323
65293
|
if (candidates.length > 1) {
|
|
@@ -65645,7 +65615,7 @@ function createTypeChecker(host) {
|
|
|
65645
65615
|
}
|
|
65646
65616
|
function getKeyPropertyName(unionType) {
|
|
65647
65617
|
const types = unionType.types;
|
|
65648
|
-
if (types.length < 10 || getObjectFlags(unionType) &
|
|
65618
|
+
if (types.length < 10 || getObjectFlags(unionType) & 32768 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */))) < 10) {
|
|
65649
65619
|
return void 0;
|
|
65650
65620
|
}
|
|
65651
65621
|
if (unionType.keyPropertyName === void 0) {
|
|
@@ -66034,7 +66004,7 @@ function createTypeChecker(host) {
|
|
|
66034
66004
|
}
|
|
66035
66005
|
return getUnionTypeFromSortedList(
|
|
66036
66006
|
filtered,
|
|
66037
|
-
type.objectFlags & (
|
|
66007
|
+
type.objectFlags & (32768 /* PrimitiveUnion */ | 16777216 /* ContainsIntersections */),
|
|
66038
66008
|
/*aliasSymbol*/
|
|
66039
66009
|
void 0,
|
|
66040
66010
|
/*aliasTypeArguments*/
|
|
@@ -66096,7 +66066,7 @@ function createTypeChecker(host) {
|
|
|
66096
66066
|
return incomplete ? { flags: 0, type: type.flags & 131072 /* Never */ ? silentNeverType : type } : type;
|
|
66097
66067
|
}
|
|
66098
66068
|
function createEvolvingArrayType(elementType) {
|
|
66099
|
-
const result = createObjectType(
|
|
66069
|
+
const result = createObjectType(256 /* EvolvingArray */);
|
|
66100
66070
|
result.elementType = elementType;
|
|
66101
66071
|
return result;
|
|
66102
66072
|
}
|
|
@@ -66116,16 +66086,16 @@ function createTypeChecker(host) {
|
|
|
66116
66086
|
return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
|
|
66117
66087
|
}
|
|
66118
66088
|
function finalizeEvolvingArrayType(type) {
|
|
66119
|
-
return getObjectFlags(type) &
|
|
66089
|
+
return getObjectFlags(type) & 256 /* EvolvingArray */ ? getFinalArrayType(type) : type;
|
|
66120
66090
|
}
|
|
66121
66091
|
function getElementTypeOfEvolvingArrayType(type) {
|
|
66122
|
-
return getObjectFlags(type) &
|
|
66092
|
+
return getObjectFlags(type) & 256 /* EvolvingArray */ ? type.elementType : neverType;
|
|
66123
66093
|
}
|
|
66124
66094
|
function isEvolvingArrayTypeList(types) {
|
|
66125
66095
|
let hasEvolvingArrayType = false;
|
|
66126
66096
|
for (const t of types) {
|
|
66127
66097
|
if (!(t.flags & 131072 /* Never */)) {
|
|
66128
|
-
if (!(getObjectFlags(t) &
|
|
66098
|
+
if (!(getObjectFlags(t) & 256 /* EvolvingArray */)) {
|
|
66129
66099
|
return false;
|
|
66130
66100
|
}
|
|
66131
66101
|
hasEvolvingArrayType = true;
|
|
@@ -66429,7 +66399,7 @@ function createTypeChecker(host) {
|
|
|
66429
66399
|
const sharedFlowStart = sharedFlowCount;
|
|
66430
66400
|
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
|
|
66431
66401
|
sharedFlowCount = sharedFlowStart;
|
|
66432
|
-
const resultType = getObjectFlags(evolvedType) &
|
|
66402
|
+
const resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
|
|
66433
66403
|
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
|
|
66434
66404
|
return declaredType;
|
|
66435
66405
|
}
|
|
@@ -66616,7 +66586,7 @@ function createTypeChecker(host) {
|
|
|
66616
66586
|
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
|
|
66617
66587
|
const flowType = getTypeAtFlowNode(flow.antecedent);
|
|
66618
66588
|
const type = getTypeFromFlowType(flowType);
|
|
66619
|
-
if (getObjectFlags(type) &
|
|
66589
|
+
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
|
|
66620
66590
|
let evolvedType2 = type;
|
|
66621
66591
|
if (node.kind === 213 /* CallExpression */) {
|
|
66622
66592
|
for (const arg of node.arguments) {
|
|
@@ -67469,7 +67439,7 @@ function createTypeChecker(host) {
|
|
|
67469
67439
|
location = location.parent;
|
|
67470
67440
|
}
|
|
67471
67441
|
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
|
|
67472
|
-
const type =
|
|
67442
|
+
const type = removeOptionalTypeMarker(
|
|
67473
67443
|
isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
|
|
67474
67444
|
location,
|
|
67475
67445
|
/*checkMode*/
|
|
@@ -67477,7 +67447,7 @@ function createTypeChecker(host) {
|
|
|
67477
67447
|
/*writeOnly*/
|
|
67478
67448
|
true
|
|
67479
67449
|
) : getTypeOfExpression(location)
|
|
67480
|
-
)
|
|
67450
|
+
);
|
|
67481
67451
|
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
|
|
67482
67452
|
return type;
|
|
67483
67453
|
}
|
|
@@ -69525,7 +69495,7 @@ function createTypeChecker(host) {
|
|
|
69525
69495
|
let literalType = type.literalType;
|
|
69526
69496
|
if (!literalType) {
|
|
69527
69497
|
literalType = type.literalType = cloneTypeReference(type);
|
|
69528
|
-
literalType.objectFlags |=
|
|
69498
|
+
literalType.objectFlags |= 16384 /* ArrayLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
69529
69499
|
}
|
|
69530
69500
|
return literalType;
|
|
69531
69501
|
}
|
|
@@ -69653,7 +69623,7 @@ function createTypeChecker(host) {
|
|
|
69653
69623
|
checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
|
|
69654
69624
|
}
|
|
69655
69625
|
}
|
|
69656
|
-
objectFlags |= getObjectFlags(type) &
|
|
69626
|
+
objectFlags |= getObjectFlags(type) & 458752 /* PropagatingFlags */;
|
|
69657
69627
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
69658
69628
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
69659
69629
|
if (nameType) {
|
|
@@ -69664,7 +69634,7 @@ function createTypeChecker(host) {
|
|
|
69664
69634
|
if (isOptional) {
|
|
69665
69635
|
prop.flags |= 16777216 /* Optional */;
|
|
69666
69636
|
}
|
|
69667
|
-
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) &
|
|
69637
|
+
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 512 /* ObjectLiteralPatternWithComputedProperties */)) {
|
|
69668
69638
|
const impliedProp = getPropertyOfType(contextualType, member.escapedName);
|
|
69669
69639
|
if (impliedProp) {
|
|
69670
69640
|
prop.flags |= impliedProp.flags & 16777216 /* Optional */;
|
|
@@ -69776,12 +69746,12 @@ function createTypeChecker(host) {
|
|
|
69776
69746
|
if (hasComputedSymbolProperty)
|
|
69777
69747
|
indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
|
|
69778
69748
|
const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, indexInfos);
|
|
69779
|
-
result.objectFlags |= objectFlags |
|
|
69749
|
+
result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
69780
69750
|
if (isJSObjectLiteral) {
|
|
69781
|
-
result.objectFlags |=
|
|
69751
|
+
result.objectFlags |= 4096 /* JSLiteral */;
|
|
69782
69752
|
}
|
|
69783
69753
|
if (patternWithComputedProperties) {
|
|
69784
|
-
result.objectFlags |=
|
|
69754
|
+
result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */;
|
|
69785
69755
|
}
|
|
69786
69756
|
if (inDestructuringPattern) {
|
|
69787
69757
|
result.pattern = node;
|
|
@@ -69843,13 +69813,13 @@ function createTypeChecker(host) {
|
|
|
69843
69813
|
let hasSpreadAnyType = false;
|
|
69844
69814
|
let typeToIntersect;
|
|
69845
69815
|
let explicitlySpecifyChildrenAttribute = false;
|
|
69846
|
-
let objectFlags =
|
|
69816
|
+
let objectFlags = 2048 /* JsxAttributes */;
|
|
69847
69817
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
|
|
69848
69818
|
for (const attributeDecl of attributes.properties) {
|
|
69849
69819
|
const member = attributeDecl.symbol;
|
|
69850
69820
|
if (isJsxAttribute(attributeDecl)) {
|
|
69851
69821
|
const exprType = checkJsxAttribute(attributeDecl, checkMode);
|
|
69852
|
-
objectFlags |= getObjectFlags(exprType) &
|
|
69822
|
+
objectFlags |= getObjectFlags(exprType) & 458752 /* PropagatingFlags */;
|
|
69853
69823
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
69854
69824
|
attributeSymbol.declarations = member.declarations;
|
|
69855
69825
|
attributeSymbol.parent = member.parent;
|
|
@@ -69970,7 +69940,7 @@ function createTypeChecker(host) {
|
|
|
69970
69940
|
function createJsxAttributesType() {
|
|
69971
69941
|
objectFlags |= freshObjectLiteralFlag;
|
|
69972
69942
|
const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, emptyArray);
|
|
69973
|
-
result.objectFlags |= objectFlags |
|
|
69943
|
+
result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 131072 /* ContainsObjectOrArrayLiteral */;
|
|
69974
69944
|
return result;
|
|
69975
69945
|
}
|
|
69976
69946
|
}
|
|
@@ -70363,7 +70333,7 @@ function createTypeChecker(host) {
|
|
|
70363
70333
|
return false;
|
|
70364
70334
|
}
|
|
70365
70335
|
function isExcessPropertyCheckTarget(type) {
|
|
70366
|
-
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) &
|
|
70336
|
+
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));
|
|
70367
70337
|
}
|
|
70368
70338
|
function checkJsxExpression(node, checkMode) {
|
|
70369
70339
|
checkGrammarJsxExpression(node);
|
|
@@ -73131,7 +73101,7 @@ function createTypeChecker(host) {
|
|
|
73131
73101
|
);
|
|
73132
73102
|
if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) {
|
|
73133
73103
|
const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray);
|
|
73134
|
-
jsAssignmentType.objectFlags |=
|
|
73104
|
+
jsAssignmentType.objectFlags |= 4096 /* JSLiteral */;
|
|
73135
73105
|
return getIntersectionType([returnType, jsAssignmentType]);
|
|
73136
73106
|
}
|
|
73137
73107
|
}
|
|
@@ -73477,7 +73447,7 @@ function createTypeChecker(host) {
|
|
|
73477
73447
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
73478
73448
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
73479
73449
|
const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
73480
|
-
result3.objectFlags |=
|
|
73450
|
+
result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
|
|
73481
73451
|
result3.node = node;
|
|
73482
73452
|
return result3;
|
|
73483
73453
|
}
|
|
@@ -74518,7 +74488,7 @@ function createTypeChecker(host) {
|
|
|
74518
74488
|
64 /* IsNonInferrable */
|
|
74519
74489
|
);
|
|
74520
74490
|
const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
|
|
74521
|
-
returnOnlyType.objectFlags |=
|
|
74491
|
+
returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
|
|
74522
74492
|
return links.contextFreeType = returnOnlyType;
|
|
74523
74493
|
}
|
|
74524
74494
|
}
|
|
@@ -85294,7 +85264,7 @@ function createTypeChecker(host) {
|
|
|
85294
85264
|
}
|
|
85295
85265
|
}
|
|
85296
85266
|
function findBestTypeForObjectLiteral(source, unionTarget) {
|
|
85297
|
-
if (getObjectFlags(source) &
|
|
85267
|
+
if (getObjectFlags(source) & 128 /* ObjectLiteral */ && someType(unionTarget, isArrayLikeType)) {
|
|
85298
85268
|
return find(unionTarget.types, (t) => !isArrayLikeType(t));
|
|
85299
85269
|
}
|
|
85300
85270
|
}
|