@typescript-deploys/pr-build 5.4.0-pr-57207-3 → 5.4.0-pr-57293-15
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 +352 -368
- package/lib/tsserver.js +518 -490
- package/lib/typescript.d.ts +22 -43
- package/lib/typescript.js +518 -489
- package/lib/typingsInstaller.js +71 -124
- 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.20240205`;
|
|
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 & 2048 /* ReverseMapped */ ? "ReverseMappedType" : this.objectFlags & 512 /* EvolvingArray */ ? "EvolvingArrayType" : "ObjectType" : "Type";
|
|
1750
|
+
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2623 /* 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 & 2048 /* 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 & 512 /* EvolvingArray */) {
|
|
2939
2939
|
const evolvingArrayType = type;
|
|
2940
2940
|
evolvingArrayProperties = {
|
|
2941
2941
|
evolvingArrayElementType: evolvingArrayType.elementType.id,
|
|
@@ -3356,13 +3356,12 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
3356
3356
|
SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 355] = "JSDocPropertyTag";
|
|
3357
3357
|
SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 356] = "JSDocThrowsTag";
|
|
3358
3358
|
SyntaxKind4[SyntaxKind4["JSDocSatisfiesTag"] = 357] = "JSDocSatisfiesTag";
|
|
3359
|
-
SyntaxKind4[SyntaxKind4["
|
|
3360
|
-
SyntaxKind4[SyntaxKind4["
|
|
3361
|
-
SyntaxKind4[SyntaxKind4["
|
|
3362
|
-
SyntaxKind4[SyntaxKind4["
|
|
3363
|
-
SyntaxKind4[SyntaxKind4["
|
|
3364
|
-
SyntaxKind4[SyntaxKind4["
|
|
3365
|
-
SyntaxKind4[SyntaxKind4["Count"] = 364] = "Count";
|
|
3359
|
+
SyntaxKind4[SyntaxKind4["SyntaxList"] = 358] = "SyntaxList";
|
|
3360
|
+
SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 359] = "NotEmittedStatement";
|
|
3361
|
+
SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 360] = "PartiallyEmittedExpression";
|
|
3362
|
+
SyntaxKind4[SyntaxKind4["CommaListExpression"] = 361] = "CommaListExpression";
|
|
3363
|
+
SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 362] = "SyntheticReferenceExpression";
|
|
3364
|
+
SyntaxKind4[SyntaxKind4["Count"] = 363] = "Count";
|
|
3366
3365
|
SyntaxKind4[SyntaxKind4["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment";
|
|
3367
3366
|
SyntaxKind4[SyntaxKind4["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment";
|
|
3368
3367
|
SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment";
|
|
@@ -3391,9 +3390,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
3391
3390
|
SyntaxKind4[SyntaxKind4["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement";
|
|
3392
3391
|
SyntaxKind4[SyntaxKind4["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
|
|
3393
3392
|
SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 316 /* JSDocTypeExpression */] = "FirstJSDocNode";
|
|
3394
|
-
SyntaxKind4[SyntaxKind4["LastJSDocNode"] =
|
|
3393
|
+
SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 357 /* JSDocSatisfiesTag */] = "LastJSDocNode";
|
|
3395
3394
|
SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 334 /* JSDocTag */] = "FirstJSDocTagNode";
|
|
3396
|
-
SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] =
|
|
3395
|
+
SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 357 /* JSDocSatisfiesTag */] = "LastJSDocTagNode";
|
|
3397
3396
|
SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword";
|
|
3398
3397
|
SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
|
|
3399
3398
|
return SyntaxKind4;
|
|
@@ -3686,42 +3685,43 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
3686
3685
|
ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple";
|
|
3687
3686
|
ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous";
|
|
3688
3687
|
ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped";
|
|
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["
|
|
3688
|
+
ObjectFlags3[ObjectFlags3["TypeAliasInstantiation"] = 64] = "TypeAliasInstantiation";
|
|
3689
|
+
ObjectFlags3[ObjectFlags3["Instantiated"] = 128] = "Instantiated";
|
|
3690
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 256] = "ObjectLiteral";
|
|
3691
|
+
ObjectFlags3[ObjectFlags3["EvolvingArray"] = 512] = "EvolvingArray";
|
|
3692
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 1024] = "ObjectLiteralPatternWithComputedProperties";
|
|
3693
|
+
ObjectFlags3[ObjectFlags3["ReverseMapped"] = 2048] = "ReverseMapped";
|
|
3694
|
+
ObjectFlags3[ObjectFlags3["JsxAttributes"] = 4096] = "JsxAttributes";
|
|
3695
|
+
ObjectFlags3[ObjectFlags3["JSLiteral"] = 8192] = "JSLiteral";
|
|
3696
|
+
ObjectFlags3[ObjectFlags3["FreshLiteral"] = 16384] = "FreshLiteral";
|
|
3697
|
+
ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 32768] = "ArrayLiteral";
|
|
3698
|
+
ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 65536] = "PrimitiveUnion";
|
|
3699
|
+
ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 131072] = "ContainsWideningType";
|
|
3700
|
+
ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 262144] = "ContainsObjectOrArrayLiteral";
|
|
3701
|
+
ObjectFlags3[ObjectFlags3["NonInferrableType"] = 524288] = "NonInferrableType";
|
|
3702
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 1048576] = "CouldContainTypeVariablesComputed";
|
|
3703
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
|
|
3704
3704
|
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"] =
|
|
3705
|
+
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 393216] = "RequiresWidening";
|
|
3706
|
+
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 917504] = "PropagatingFlags";
|
|
3707
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 160] = "InstantiatedMapped";
|
|
3708
|
+
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 2623] = "ObjectTypeKindMask";
|
|
3709
|
+
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 4194304] = "ContainsSpread";
|
|
3710
|
+
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 8388608] = "ObjectRestType";
|
|
3711
|
+
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
|
|
3712
|
+
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
|
|
3713
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
|
|
3714
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
|
|
3715
|
+
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
|
|
3716
|
+
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
|
|
3717
|
+
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 16777216] = "IsGenericIndexType";
|
|
3718
|
+
ObjectFlags3[ObjectFlags3["IsGenericType"] = 25165824] = "IsGenericType";
|
|
3719
|
+
ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 33554432] = "ContainsIntersections";
|
|
3720
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 67108864] = "IsUnknownLikeUnionComputed";
|
|
3721
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 134217728] = "IsUnknownLikeUnion";
|
|
3722
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 33554432] = "IsNeverIntersectionComputed";
|
|
3723
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 67108864] = "IsNeverIntersection";
|
|
3724
|
+
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 134217728] = "IsConstrainedTypeVariable";
|
|
3725
3725
|
return ObjectFlags3;
|
|
3726
3726
|
})(ObjectFlags || {});
|
|
3727
3727
|
var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
|
|
@@ -6924,7 +6924,6 @@ var Diagnostics = {
|
|
|
6924
6924
|
Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
|
|
6925
6925
|
Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
|
|
6926
6926
|
Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
|
|
6927
|
-
File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
|
|
6928
6927
|
Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
|
|
6929
6928
|
Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
|
|
6930
6929
|
Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
|
|
@@ -11076,8 +11075,8 @@ function isExpressionKind(kind) {
|
|
|
11076
11075
|
case 230 /* SpreadElement */:
|
|
11077
11076
|
case 234 /* AsExpression */:
|
|
11078
11077
|
case 232 /* OmittedExpression */:
|
|
11079
|
-
case
|
|
11080
|
-
case
|
|
11078
|
+
case 361 /* CommaListExpression */:
|
|
11079
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
11081
11080
|
case 238 /* SatisfiesExpression */:
|
|
11082
11081
|
return true;
|
|
11083
11082
|
default:
|
|
@@ -11248,7 +11247,7 @@ function isDeclarationStatementKind(kind) {
|
|
|
11248
11247
|
return kind === 262 /* FunctionDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 270 /* NamespaceExportDeclaration */;
|
|
11249
11248
|
}
|
|
11250
11249
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
11251
|
-
return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind ===
|
|
11250
|
+
return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind === 359 /* NotEmittedStatement */;
|
|
11252
11251
|
}
|
|
11253
11252
|
function isDeclaration(node) {
|
|
11254
11253
|
if (node.kind === 168 /* TypeParameter */) {
|
|
@@ -11309,10 +11308,10 @@ function isCaseOrDefaultClause(node) {
|
|
|
11309
11308
|
return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */;
|
|
11310
11309
|
}
|
|
11311
11310
|
function isJSDocNode(node) {
|
|
11312
|
-
return node.kind >= 316 /* FirstJSDocNode */ && node.kind <=
|
|
11311
|
+
return node.kind >= 316 /* FirstJSDocNode */ && node.kind <= 357 /* LastJSDocNode */;
|
|
11313
11312
|
}
|
|
11314
11313
|
function isJSDocTag(node) {
|
|
11315
|
-
return node.kind >= 334 /* FirstJSDocTagNode */ && node.kind <=
|
|
11314
|
+
return node.kind >= 334 /* FirstJSDocTagNode */ && node.kind <= 357 /* LastJSDocTagNode */;
|
|
11316
11315
|
}
|
|
11317
11316
|
function isSetAccessor(node) {
|
|
11318
11317
|
return node.kind === 178 /* SetAccessor */;
|
|
@@ -11753,7 +11752,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
11753
11752
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
11754
11753
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
11755
11754
|
}
|
|
11756
|
-
if (node.kind ===
|
|
11755
|
+
if (node.kind === 358 /* SyntaxList */ && node._children.length > 0) {
|
|
11757
11756
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
11758
11757
|
}
|
|
11759
11758
|
return skipTrivia(
|
|
@@ -13707,7 +13706,6 @@ function tryGetModuleSpecifierFromDeclaration(node) {
|
|
|
13707
13706
|
))) == null ? void 0 : _a.arguments[0];
|
|
13708
13707
|
case 272 /* ImportDeclaration */:
|
|
13709
13708
|
case 278 /* ExportDeclaration */:
|
|
13710
|
-
case 358 /* JSDocImportTypeTag */:
|
|
13711
13709
|
return tryCast(node.moduleSpecifier, isStringLiteralLike);
|
|
13712
13710
|
case 271 /* ImportEqualsDeclaration */:
|
|
13713
13711
|
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
|
|
@@ -13729,7 +13727,6 @@ function getExternalModuleName(node) {
|
|
|
13729
13727
|
switch (node.kind) {
|
|
13730
13728
|
case 272 /* ImportDeclaration */:
|
|
13731
13729
|
case 278 /* ExportDeclaration */:
|
|
13732
|
-
case 358 /* JSDocImportTypeTag */:
|
|
13733
13730
|
return node.moduleSpecifier;
|
|
13734
13731
|
case 271 /* ImportEqualsDeclaration */:
|
|
13735
13732
|
return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
|
|
@@ -14541,7 +14538,7 @@ function getOperator(expression) {
|
|
|
14541
14538
|
}
|
|
14542
14539
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
14543
14540
|
switch (nodeKind) {
|
|
14544
|
-
case
|
|
14541
|
+
case 361 /* CommaListExpression */:
|
|
14545
14542
|
return 0 /* Comma */;
|
|
14546
14543
|
case 230 /* SpreadElement */:
|
|
14547
14544
|
return 1 /* Spread */;
|
|
@@ -16106,7 +16103,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
16106
16103
|
case 212 /* ElementAccessExpression */:
|
|
16107
16104
|
case 211 /* PropertyAccessExpression */:
|
|
16108
16105
|
case 235 /* NonNullExpression */:
|
|
16109
|
-
case
|
|
16106
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
16110
16107
|
case 238 /* SatisfiesExpression */:
|
|
16111
16108
|
node = node.expression;
|
|
16112
16109
|
continue;
|
|
@@ -17496,7 +17493,7 @@ function getContainingNodeArray(node) {
|
|
|
17496
17493
|
return parent.types;
|
|
17497
17494
|
case 189 /* TupleType */:
|
|
17498
17495
|
case 209 /* ArrayLiteralExpression */:
|
|
17499
|
-
case
|
|
17496
|
+
case 361 /* CommaListExpression */:
|
|
17500
17497
|
case 275 /* NamedImports */:
|
|
17501
17498
|
case 279 /* NamedExports */:
|
|
17502
17499
|
return parent.elements;
|
|
@@ -18681,8 +18678,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18681
18678
|
updateJSDocImplementsTag,
|
|
18682
18679
|
createJSDocSeeTag,
|
|
18683
18680
|
updateJSDocSeeTag,
|
|
18684
|
-
createJSDocImportTypeTag,
|
|
18685
|
-
updateJSDocImportTypeTag,
|
|
18686
18681
|
createJSDocNameReference,
|
|
18687
18682
|
updateJSDocNameReference,
|
|
18688
18683
|
createJSDocMemberName,
|
|
@@ -21461,16 +21456,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21461
21456
|
function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
|
|
21462
21457
|
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node;
|
|
21463
21458
|
}
|
|
21464
|
-
function createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comment) {
|
|
21465
|
-
const node = createBaseJSDocTag(358 /* JSDocImportTypeTag */, tagName ?? createIdentifier("importType"), comment);
|
|
21466
|
-
node.importClause = importClause;
|
|
21467
|
-
node.moduleSpecifier = moduleSpecifier;
|
|
21468
|
-
node.comment = comment;
|
|
21469
|
-
return node;
|
|
21470
|
-
}
|
|
21471
|
-
function updateJSDocImportTypeTag(node, tagName, importClause, moduleSpecifier, comment) {
|
|
21472
|
-
return node.tagName !== tagName || node.comment !== comment || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier ? update(createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comment), node) : node;
|
|
21473
|
-
}
|
|
21474
21459
|
function createJSDocText(text) {
|
|
21475
21460
|
const node = createBaseNode(328 /* JSDocText */);
|
|
21476
21461
|
node.text = text;
|
|
@@ -21909,18 +21894,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21909
21894
|
return node;
|
|
21910
21895
|
}
|
|
21911
21896
|
function createSyntaxList(children) {
|
|
21912
|
-
const node = createBaseNode(
|
|
21897
|
+
const node = createBaseNode(358 /* SyntaxList */);
|
|
21913
21898
|
node._children = children;
|
|
21914
21899
|
return node;
|
|
21915
21900
|
}
|
|
21916
21901
|
function createNotEmittedStatement(original) {
|
|
21917
|
-
const node = createBaseNode(
|
|
21902
|
+
const node = createBaseNode(359 /* NotEmittedStatement */);
|
|
21918
21903
|
node.original = original;
|
|
21919
21904
|
setTextRange(node, original);
|
|
21920
21905
|
return node;
|
|
21921
21906
|
}
|
|
21922
21907
|
function createPartiallyEmittedExpression(expression, original) {
|
|
21923
|
-
const node = createBaseNode(
|
|
21908
|
+
const node = createBaseNode(360 /* PartiallyEmittedExpression */);
|
|
21924
21909
|
node.expression = expression;
|
|
21925
21910
|
node.original = original;
|
|
21926
21911
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -21942,7 +21927,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21942
21927
|
return node;
|
|
21943
21928
|
}
|
|
21944
21929
|
function createCommaListExpression(elements) {
|
|
21945
|
-
const node = createBaseNode(
|
|
21930
|
+
const node = createBaseNode(361 /* CommaListExpression */);
|
|
21946
21931
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
21947
21932
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
21948
21933
|
return node;
|
|
@@ -21951,7 +21936,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21951
21936
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
21952
21937
|
}
|
|
21953
21938
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
21954
|
-
const node = createBaseNode(
|
|
21939
|
+
const node = createBaseNode(362 /* SyntheticReferenceExpression */);
|
|
21955
21940
|
node.expression = expression;
|
|
21956
21941
|
node.thisArg = thisArg;
|
|
21957
21942
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -22197,7 +22182,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22197
22182
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
22198
22183
|
case 235 /* NonNullExpression */:
|
|
22199
22184
|
return updateNonNullExpression(outerExpression, expression);
|
|
22200
|
-
case
|
|
22185
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
22201
22186
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
22202
22187
|
}
|
|
22203
22188
|
}
|
|
@@ -22607,8 +22592,6 @@ function getDefaultTagNameForKind(kind) {
|
|
|
22607
22592
|
return "augments";
|
|
22608
22593
|
case 336 /* JSDocImplementsTag */:
|
|
22609
22594
|
return "implements";
|
|
22610
|
-
case 358 /* JSDocImportTypeTag */:
|
|
22611
|
-
return "importType";
|
|
22612
22595
|
default:
|
|
22613
22596
|
return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
|
|
22614
22597
|
}
|
|
@@ -22749,7 +22732,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
22749
22732
|
case 216 /* TypeAssertionExpression */:
|
|
22750
22733
|
case 238 /* SatisfiesExpression */:
|
|
22751
22734
|
case 234 /* AsExpression */:
|
|
22752
|
-
case
|
|
22735
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
22753
22736
|
case 217 /* ParenthesizedExpression */:
|
|
22754
22737
|
case 108 /* SuperKeyword */:
|
|
22755
22738
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -24653,10 +24636,10 @@ function isMetaProperty(node) {
|
|
|
24653
24636
|
return node.kind === 236 /* MetaProperty */;
|
|
24654
24637
|
}
|
|
24655
24638
|
function isPartiallyEmittedExpression(node) {
|
|
24656
|
-
return node.kind ===
|
|
24639
|
+
return node.kind === 360 /* PartiallyEmittedExpression */;
|
|
24657
24640
|
}
|
|
24658
24641
|
function isCommaListExpression(node) {
|
|
24659
|
-
return node.kind ===
|
|
24642
|
+
return node.kind === 361 /* CommaListExpression */;
|
|
24660
24643
|
}
|
|
24661
24644
|
function isTemplateSpan(node) {
|
|
24662
24645
|
return node.kind === 239 /* TemplateSpan */;
|
|
@@ -24779,10 +24762,10 @@ function isExportSpecifier(node) {
|
|
|
24779
24762
|
return node.kind === 281 /* ExportSpecifier */;
|
|
24780
24763
|
}
|
|
24781
24764
|
function isNotEmittedStatement(node) {
|
|
24782
|
-
return node.kind ===
|
|
24765
|
+
return node.kind === 359 /* NotEmittedStatement */;
|
|
24783
24766
|
}
|
|
24784
24767
|
function isSyntheticReference(node) {
|
|
24785
|
-
return node.kind ===
|
|
24768
|
+
return node.kind === 362 /* SyntheticReferenceExpression */;
|
|
24786
24769
|
}
|
|
24787
24770
|
function isExternalModuleReference(node) {
|
|
24788
24771
|
return node.kind === 283 /* ExternalModuleReference */;
|
|
@@ -24955,9 +24938,6 @@ function isJSDocImplementsTag(node) {
|
|
|
24955
24938
|
function isJSDocSatisfiesTag(node) {
|
|
24956
24939
|
return node.kind === 357 /* JSDocSatisfiesTag */;
|
|
24957
24940
|
}
|
|
24958
|
-
function isJSDocImportTypeTag(node) {
|
|
24959
|
-
return node.kind === 358 /* JSDocImportTypeTag */;
|
|
24960
|
-
}
|
|
24961
24941
|
|
|
24962
24942
|
// src/compiler/factory/utilities.ts
|
|
24963
24943
|
function createEmptyExports(factory2) {
|
|
@@ -25340,7 +25320,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
25340
25320
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
25341
25321
|
case 235 /* NonNullExpression */:
|
|
25342
25322
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
25343
|
-
case
|
|
25323
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
25344
25324
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
25345
25325
|
}
|
|
25346
25326
|
return false;
|
|
@@ -26416,7 +26396,7 @@ var forEachChildTable = {
|
|
|
26416
26396
|
[282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
26417
26397
|
return visitNodes(cbNode, cbNodes, node.modifiers);
|
|
26418
26398
|
},
|
|
26419
|
-
[
|
|
26399
|
+
[361 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
26420
26400
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
26421
26401
|
},
|
|
26422
26402
|
[284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -26511,8 +26491,7 @@ var forEachChildTable = {
|
|
|
26511
26491
|
[343 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
26512
26492
|
[338 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
26513
26493
|
[344 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
26514
|
-
[
|
|
26515
|
-
[361 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
26494
|
+
[360 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
26516
26495
|
};
|
|
26517
26496
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
26518
26497
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -26563,9 +26542,6 @@ function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) {
|
|
|
26563
26542
|
function forEachChildInJSDocTag(node, cbNode, cbNodes) {
|
|
26564
26543
|
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
26565
26544
|
}
|
|
26566
|
-
function forEachChildInJSDocImportTypeTag(node, cbNode, cbNodes) {
|
|
26567
|
-
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
26568
|
-
}
|
|
26569
26545
|
function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
|
|
26570
26546
|
return visitNode2(cbNode, node.expression);
|
|
26571
26547
|
}
|
|
@@ -32801,9 +32777,6 @@ var Parser;
|
|
|
32801
32777
|
case "throws":
|
|
32802
32778
|
tag = parseThrowsTag(start2, tagName, margin, indentText);
|
|
32803
32779
|
break;
|
|
32804
|
-
case "importType":
|
|
32805
|
-
tag = parseImportTypeTag(start2, tagName, margin, indentText);
|
|
32806
|
-
break;
|
|
32807
32780
|
default:
|
|
32808
32781
|
tag = parseUnknownTag(start2, tagName, margin, indentText);
|
|
32809
32782
|
break;
|
|
@@ -33123,27 +33096,6 @@ var Parser;
|
|
|
33123
33096
|
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
|
|
33124
33097
|
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
|
|
33125
33098
|
}
|
|
33126
|
-
function parseImportTypeTag(start2, tagName, margin, indentText) {
|
|
33127
|
-
const afterImportTypeTagPos = scanner.getTokenFullStart();
|
|
33128
|
-
let identifier;
|
|
33129
|
-
if (isIdentifier2()) {
|
|
33130
|
-
identifier = parseIdentifier();
|
|
33131
|
-
}
|
|
33132
|
-
let importClause;
|
|
33133
|
-
if (identifier || token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */) {
|
|
33134
|
-
importClause = parseImportClause(
|
|
33135
|
-
identifier,
|
|
33136
|
-
afterImportTypeTagPos,
|
|
33137
|
-
/*isTypeOnly*/
|
|
33138
|
-
true
|
|
33139
|
-
);
|
|
33140
|
-
parseExpected(161 /* FromKeyword */);
|
|
33141
|
-
}
|
|
33142
|
-
Debug.assert(importClause);
|
|
33143
|
-
const moduleSpecifier = parseModuleSpecifier();
|
|
33144
|
-
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
|
|
33145
|
-
return finishNode(factory2.createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comments2), start2);
|
|
33146
|
-
}
|
|
33147
33099
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
33148
33100
|
const usedBrace = parseOptional(19 /* OpenBraceToken */);
|
|
33149
33101
|
const pos = getNodePos();
|
|
@@ -38769,15 +38721,9 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
38769
38721
|
}
|
|
38770
38722
|
}
|
|
38771
38723
|
const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
|
|
38772
|
-
const fromFile =
|
|
38724
|
+
const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
|
|
38773
38725
|
if (fromFile) {
|
|
38774
|
-
|
|
38775
|
-
if (resolved) {
|
|
38776
|
-
return noPackageId(resolved);
|
|
38777
|
-
}
|
|
38778
|
-
if (state2.traceEnabled) {
|
|
38779
|
-
trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
|
|
38780
|
-
}
|
|
38726
|
+
return noPackageId(fromFile);
|
|
38781
38727
|
}
|
|
38782
38728
|
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
|
|
38783
38729
|
const features = state2.features;
|
|
@@ -38833,10 +38779,6 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
38833
38779
|
return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
|
|
38834
38780
|
}
|
|
38835
38781
|
}
|
|
38836
|
-
function resolvedIfExtensionMatches(extensions, path, resolvedUsingTsExtension) {
|
|
38837
|
-
const ext = tryGetExtensionFromPath2(path);
|
|
38838
|
-
return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext, resolvedUsingTsExtension } : void 0;
|
|
38839
|
-
}
|
|
38840
38782
|
function extensionIsOk(extensions, extension) {
|
|
38841
38783
|
return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
|
|
38842
38784
|
}
|
|
@@ -43702,7 +43644,7 @@ function createTypeChecker(host) {
|
|
|
43702
43644
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
43703
43645
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
43704
43646
|
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
43705
|
-
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 :
|
|
43647
|
+
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 16384 /* FreshLiteral */;
|
|
43706
43648
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
43707
43649
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
43708
43650
|
var emitResolver = createResolver();
|
|
@@ -44205,7 +44147,7 @@ function createTypeChecker(host) {
|
|
|
44205
44147
|
var errorTypes = /* @__PURE__ */ new Map();
|
|
44206
44148
|
var seenIntrinsicNames = /* @__PURE__ */ new Set();
|
|
44207
44149
|
var anyType = createIntrinsicType(1 /* Any */, "any");
|
|
44208
|
-
var autoType = createIntrinsicType(1 /* Any */, "any",
|
|
44150
|
+
var autoType = createIntrinsicType(1 /* Any */, "any", 524288 /* NonInferrableType */, "auto");
|
|
44209
44151
|
var wildcardType = createIntrinsicType(
|
|
44210
44152
|
1 /* Any */,
|
|
44211
44153
|
"any",
|
|
@@ -44222,7 +44164,7 @@ function createTypeChecker(host) {
|
|
|
44222
44164
|
);
|
|
44223
44165
|
var errorType = createIntrinsicType(1 /* Any */, "error");
|
|
44224
44166
|
var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
|
|
44225
|
-
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any",
|
|
44167
|
+
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 131072 /* ContainsWideningType */, "non-inferrable");
|
|
44226
44168
|
var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
|
|
44227
44169
|
var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
44228
44170
|
var nonNullUnknownType = createIntrinsicType(
|
|
@@ -44233,7 +44175,7 @@ function createTypeChecker(host) {
|
|
|
44233
44175
|
"non-null"
|
|
44234
44176
|
);
|
|
44235
44177
|
var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
44236
|
-
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined",
|
|
44178
|
+
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */, "widening");
|
|
44237
44179
|
var missingType = createIntrinsicType(
|
|
44238
44180
|
32768 /* Undefined */,
|
|
44239
44181
|
"undefined",
|
|
@@ -44250,7 +44192,7 @@ function createTypeChecker(host) {
|
|
|
44250
44192
|
"optional"
|
|
44251
44193
|
);
|
|
44252
44194
|
var nullType = createIntrinsicType(65536 /* Null */, "null");
|
|
44253
|
-
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null",
|
|
44195
|
+
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 131072 /* ContainsWideningType */, "widening");
|
|
44254
44196
|
var stringType = createIntrinsicType(4 /* String */, "string");
|
|
44255
44197
|
var numberType = createIntrinsicType(8 /* Number */, "number");
|
|
44256
44198
|
var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
|
|
@@ -44282,7 +44224,7 @@ function createTypeChecker(host) {
|
|
|
44282
44224
|
var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol");
|
|
44283
44225
|
var voidType = createIntrinsicType(16384 /* Void */, "void");
|
|
44284
44226
|
var neverType = createIntrinsicType(131072 /* Never */, "never");
|
|
44285
|
-
var silentNeverType = createIntrinsicType(131072 /* Never */, "never",
|
|
44227
|
+
var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 524288 /* NonInferrableType */, "silent");
|
|
44286
44228
|
var implicitNeverType = createIntrinsicType(
|
|
44287
44229
|
131072 /* Never */,
|
|
44288
44230
|
"never",
|
|
@@ -44349,7 +44291,7 @@ function createTypeChecker(host) {
|
|
|
44349
44291
|
emptyArray,
|
|
44350
44292
|
emptyArray
|
|
44351
44293
|
);
|
|
44352
|
-
emptyJsxObjectType.objectFlags |=
|
|
44294
|
+
emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */;
|
|
44353
44295
|
var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
44354
44296
|
emptyTypeLiteralSymbol.members = createSymbolTable();
|
|
44355
44297
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
@@ -44379,7 +44321,7 @@ function createTypeChecker(host) {
|
|
|
44379
44321
|
emptyArray,
|
|
44380
44322
|
emptyArray
|
|
44381
44323
|
);
|
|
44382
|
-
anyFunctionType.objectFlags |=
|
|
44324
|
+
anyFunctionType.objectFlags |= 524288 /* NonInferrableType */;
|
|
44383
44325
|
var noConstraintType = createAnonymousType(
|
|
44384
44326
|
/*symbol*/
|
|
44385
44327
|
void 0,
|
|
@@ -46969,7 +46911,7 @@ function createTypeChecker(host) {
|
|
|
46969
46911
|
return ambientModule;
|
|
46970
46912
|
}
|
|
46971
46913
|
const currentSourceFile = getSourceFileOfNode(location);
|
|
46972
|
-
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (
|
|
46914
|
+
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
|
|
46973
46915
|
location.initializer,
|
|
46974
46916
|
/*requireStringLiteralLikeArgument*/
|
|
46975
46917
|
true
|
|
@@ -47617,7 +47559,7 @@ function createTypeChecker(host) {
|
|
|
47617
47559
|
const type = createType(kind);
|
|
47618
47560
|
type.intrinsicName = intrinsicName;
|
|
47619
47561
|
type.debugIntrinsicName = debugIntrinsicName;
|
|
47620
|
-
type.objectFlags = objectFlags |
|
|
47562
|
+
type.objectFlags = objectFlags | 1048576 /* CouldContainTypeVariablesComputed */ | 4194304 /* IsGenericTypeComputed */ | 67108864 /* IsUnknownLikeUnionComputed */ | 33554432 /* IsNeverIntersectionComputed */;
|
|
47621
47563
|
return type;
|
|
47622
47564
|
}
|
|
47623
47565
|
function checkIntrinsicName(name, debug) {
|
|
@@ -48206,7 +48148,7 @@ function createTypeChecker(host) {
|
|
|
48206
48148
|
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
48207
48149
|
}
|
|
48208
48150
|
function isClassInstanceSide(type) {
|
|
48209
|
-
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) &
|
|
48151
|
+
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 33554432 /* IsClassInstanceClone */));
|
|
48210
48152
|
}
|
|
48211
48153
|
function createNodeBuilder() {
|
|
48212
48154
|
return {
|
|
@@ -48295,9 +48237,7 @@ function createTypeChecker(host) {
|
|
|
48295
48237
|
context.approximateLength += 3;
|
|
48296
48238
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
48297
48239
|
}
|
|
48298
|
-
|
|
48299
|
-
type = getReducedType(type);
|
|
48300
|
-
}
|
|
48240
|
+
type = context.flags & 536870912 /* NoTypeReduction */ ? getResolvedType(type) : getReducedType(type);
|
|
48301
48241
|
if (type.flags & 1 /* Any */) {
|
|
48302
48242
|
if (type.aliasSymbol) {
|
|
48303
48243
|
return factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
|
|
@@ -48669,7 +48609,7 @@ function createTypeChecker(host) {
|
|
|
48669
48609
|
const typeId = type2.id;
|
|
48670
48610
|
const symbol = type2.symbol;
|
|
48671
48611
|
if (symbol) {
|
|
48672
|
-
const isInstantiationExpressionType = !!(getObjectFlags(type2) &
|
|
48612
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 16777216 /* InstantiationExpressionType */);
|
|
48673
48613
|
if (isInstantiationExpressionType) {
|
|
48674
48614
|
const instantiationExpressionType = type2;
|
|
48675
48615
|
const existing = instantiationExpressionType.node;
|
|
@@ -49007,7 +48947,7 @@ function createTypeChecker(host) {
|
|
|
49007
48947
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
49008
48948
|
}
|
|
49009
48949
|
for (const info of resolvedType.indexInfos) {
|
|
49010
|
-
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags &
|
|
48950
|
+
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 2048 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
49011
48951
|
}
|
|
49012
48952
|
const properties = resolvedType.properties;
|
|
49013
48953
|
if (!properties) {
|
|
@@ -51270,7 +51210,6 @@ function createTypeChecker(host) {
|
|
|
51270
51210
|
case 273 /* ImportClause */: {
|
|
51271
51211
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
51272
51212
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier;
|
|
51273
|
-
const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
|
|
51274
51213
|
addResult(
|
|
51275
51214
|
factory.createImportDeclaration(
|
|
51276
51215
|
/*modifiers*/
|
|
@@ -51283,7 +51222,7 @@ function createTypeChecker(host) {
|
|
|
51283
51222
|
void 0
|
|
51284
51223
|
),
|
|
51285
51224
|
specifier2,
|
|
51286
|
-
attributes
|
|
51225
|
+
node.parent.attributes
|
|
51287
51226
|
),
|
|
51288
51227
|
0 /* None */
|
|
51289
51228
|
);
|
|
@@ -51292,7 +51231,6 @@ function createTypeChecker(host) {
|
|
|
51292
51231
|
case 274 /* NamespaceImport */: {
|
|
51293
51232
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
51294
51233
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier;
|
|
51295
|
-
const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
|
|
51296
51234
|
addResult(
|
|
51297
51235
|
factory.createImportDeclaration(
|
|
51298
51236
|
/*modifiers*/
|
|
@@ -51305,7 +51243,7 @@ function createTypeChecker(host) {
|
|
|
51305
51243
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
51306
51244
|
),
|
|
51307
51245
|
specifier2,
|
|
51308
|
-
attributes
|
|
51246
|
+
node.parent.attributes
|
|
51309
51247
|
),
|
|
51310
51248
|
0 /* None */
|
|
51311
51249
|
);
|
|
@@ -51327,7 +51265,6 @@ function createTypeChecker(host) {
|
|
|
51327
51265
|
case 276 /* ImportSpecifier */: {
|
|
51328
51266
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
51329
51267
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier;
|
|
51330
|
-
const attributes = isImportDeclaration(node.parent.parent.parent) ? node.parent.parent.parent.attributes : void 0;
|
|
51331
51268
|
addResult(
|
|
51332
51269
|
factory.createImportDeclaration(
|
|
51333
51270
|
/*modifiers*/
|
|
@@ -51347,7 +51284,7 @@ function createTypeChecker(host) {
|
|
|
51347
51284
|
])
|
|
51348
51285
|
),
|
|
51349
51286
|
specifier2,
|
|
51350
|
-
attributes
|
|
51287
|
+
node.parent.parent.parent.attributes
|
|
51351
51288
|
),
|
|
51352
51289
|
0 /* None */
|
|
51353
51290
|
);
|
|
@@ -52254,7 +52191,7 @@ function createTypeChecker(host) {
|
|
|
52254
52191
|
));
|
|
52255
52192
|
}
|
|
52256
52193
|
const result = createAnonymousType(symbol, members, emptyArray, emptyArray, getIndexInfosOfType(source));
|
|
52257
|
-
result.objectFlags |=
|
|
52194
|
+
result.objectFlags |= 8388608 /* ObjectRestType */;
|
|
52258
52195
|
return result;
|
|
52259
52196
|
}
|
|
52260
52197
|
function isGenericTypeWithUndefinedConstraint(type) {
|
|
@@ -52684,7 +52621,7 @@ function createTypeChecker(host) {
|
|
|
52684
52621
|
mergeSymbolTable(exports2, s.exports);
|
|
52685
52622
|
}
|
|
52686
52623
|
const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
|
|
52687
|
-
type.objectFlags |=
|
|
52624
|
+
type.objectFlags |= 8192 /* JSLiteral */;
|
|
52688
52625
|
return type;
|
|
52689
52626
|
}
|
|
52690
52627
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
@@ -52805,9 +52742,9 @@ function createTypeChecker(host) {
|
|
|
52805
52742
|
result.aliasTypeArguments = length(args) ? args : void 0;
|
|
52806
52743
|
}
|
|
52807
52744
|
}
|
|
52808
|
-
result.objectFlags |= getObjectFlags(type) &
|
|
52745
|
+
result.objectFlags |= getObjectFlags(type) & 8192 /* JSLiteral */;
|
|
52809
52746
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
52810
|
-
result.objectFlags |=
|
|
52747
|
+
result.objectFlags |= 33554432 /* IsClassInstanceClone */;
|
|
52811
52748
|
}
|
|
52812
52749
|
return result;
|
|
52813
52750
|
}
|
|
@@ -52860,7 +52797,7 @@ function createTypeChecker(host) {
|
|
|
52860
52797
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) {
|
|
52861
52798
|
const members = createSymbolTable();
|
|
52862
52799
|
let stringIndexInfo;
|
|
52863
|
-
let objectFlags =
|
|
52800
|
+
let objectFlags = 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
52864
52801
|
forEach(pattern.elements, (e) => {
|
|
52865
52802
|
const name = e.propertyName || e.name;
|
|
52866
52803
|
if (e.dotDotDotToken) {
|
|
@@ -52874,7 +52811,7 @@ function createTypeChecker(host) {
|
|
|
52874
52811
|
}
|
|
52875
52812
|
const exprType = getLiteralTypeFromPropertyName(name);
|
|
52876
52813
|
if (!isTypeUsableAsPropertyName(exprType)) {
|
|
52877
|
-
objectFlags |=
|
|
52814
|
+
objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
52878
52815
|
return;
|
|
52879
52816
|
}
|
|
52880
52817
|
const text = getPropertyNameFromType(exprType);
|
|
@@ -52895,7 +52832,7 @@ function createTypeChecker(host) {
|
|
|
52895
52832
|
result.objectFlags |= objectFlags;
|
|
52896
52833
|
if (includePatternInType) {
|
|
52897
52834
|
result.pattern = pattern;
|
|
52898
|
-
result.objectFlags |=
|
|
52835
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
52899
52836
|
}
|
|
52900
52837
|
return result;
|
|
52901
52838
|
}
|
|
@@ -52913,7 +52850,7 @@ function createTypeChecker(host) {
|
|
|
52913
52850
|
if (includePatternInType) {
|
|
52914
52851
|
result = cloneTypeReference(result);
|
|
52915
52852
|
result.pattern = pattern;
|
|
52916
|
-
result.objectFlags |=
|
|
52853
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
52917
52854
|
}
|
|
52918
52855
|
return result;
|
|
52919
52856
|
}
|
|
@@ -52941,7 +52878,7 @@ function createTypeChecker(host) {
|
|
|
52941
52878
|
members.set(member.escapedName, member);
|
|
52942
52879
|
});
|
|
52943
52880
|
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
52944
|
-
type.objectFlags |=
|
|
52881
|
+
type.objectFlags |= 256 /* ObjectLiteral */ | 524288 /* NonInferrableType */;
|
|
52945
52882
|
links.resolvedType = type;
|
|
52946
52883
|
}
|
|
52947
52884
|
return links.resolvedType;
|
|
@@ -54729,6 +54666,14 @@ function createTypeChecker(host) {
|
|
|
54729
54666
|
type.constructSignatures = constructSignatures;
|
|
54730
54667
|
}
|
|
54731
54668
|
}
|
|
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
|
+
}
|
|
54732
54677
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
54733
54678
|
return instantiateType(instantiable, createTypeMapper([type.indexType, type.objectType], [getNumberLiteralType(0), createTupleType([replacement])]));
|
|
54734
54679
|
}
|
|
@@ -54995,12 +54940,14 @@ function createTypeChecker(host) {
|
|
|
54995
54940
|
resolveTypeReferenceMembers(type);
|
|
54996
54941
|
} else if (type.objectFlags & 3 /* ClassOrInterface */) {
|
|
54997
54942
|
resolveClassOrInterfaceMembers(type);
|
|
54998
|
-
} else if (type.objectFlags &
|
|
54943
|
+
} else if (type.objectFlags & 2048 /* ReverseMapped */) {
|
|
54999
54944
|
resolveReverseMappedTypeMembers(type);
|
|
55000
54945
|
} else if (type.objectFlags & 16 /* Anonymous */) {
|
|
55001
54946
|
resolveAnonymousTypeMembers(type);
|
|
55002
54947
|
} else if (type.objectFlags & 32 /* Mapped */) {
|
|
55003
54948
|
resolveMappedTypeMembers(type);
|
|
54949
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
54950
|
+
resolveTypeAliasInstantiationMembers(type);
|
|
55004
54951
|
} else {
|
|
55005
54952
|
Debug.fail("Unhandled object type " + Debug.formatObjectFlags(type.objectFlags));
|
|
55006
54953
|
}
|
|
@@ -55446,7 +55393,7 @@ function createTypeChecker(host) {
|
|
|
55446
55393
|
if (indexInfo) {
|
|
55447
55394
|
checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
|
|
55448
55395
|
indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
|
|
55449
|
-
} else if (isObjectLiteralType(type) && !(getObjectFlags(type) &
|
|
55396
|
+
} else if (isObjectLiteralType(type) && !(getObjectFlags(type) & 4194304 /* ContainsSpread */)) {
|
|
55450
55397
|
checkFlags |= 32 /* WritePartial */;
|
|
55451
55398
|
indexTypes = append(indexTypes, undefinedType);
|
|
55452
55399
|
} else {
|
|
@@ -55572,22 +55519,22 @@ function createTypeChecker(host) {
|
|
|
55572
55519
|
return property && !(getCheckFlags(property) & 16 /* ReadPartial */) ? property : void 0;
|
|
55573
55520
|
}
|
|
55574
55521
|
function getReducedType(type) {
|
|
55575
|
-
if (type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
55522
|
+
if (type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */) {
|
|
55576
55523
|
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
|
55577
55524
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
55578
|
-
if (!(type.objectFlags &
|
|
55579
|
-
type.objectFlags |=
|
|
55525
|
+
if (!(type.objectFlags & 33554432 /* IsNeverIntersectionComputed */)) {
|
|
55526
|
+
type.objectFlags |= 33554432 /* IsNeverIntersectionComputed */ | (some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 67108864 /* IsNeverIntersection */ : 0);
|
|
55580
55527
|
}
|
|
55581
|
-
return type.objectFlags &
|
|
55528
|
+
return type.objectFlags & 67108864 /* IsNeverIntersection */ ? neverType : type;
|
|
55582
55529
|
}
|
|
55583
|
-
return type;
|
|
55530
|
+
return getResolvedType(type);
|
|
55584
55531
|
}
|
|
55585
55532
|
function getReducedUnionType(unionType) {
|
|
55586
55533
|
const reducedTypes = sameMap(unionType.types, getReducedType);
|
|
55587
55534
|
if (reducedTypes === unionType.types) {
|
|
55588
55535
|
return unionType;
|
|
55589
55536
|
}
|
|
55590
|
-
const reduced = getUnionType(reducedTypes);
|
|
55537
|
+
const reduced = getResolvedType(getUnionType(reducedTypes));
|
|
55591
55538
|
if (reduced.flags & 1048576 /* Union */) {
|
|
55592
55539
|
reduced.resolvedReducedType = reduced;
|
|
55593
55540
|
}
|
|
@@ -55603,14 +55550,14 @@ function createTypeChecker(host) {
|
|
|
55603
55550
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
55604
55551
|
}
|
|
55605
55552
|
function isGenericReducibleType(type) {
|
|
55606
|
-
return !!(type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
55553
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
55607
55554
|
}
|
|
55608
55555
|
function isReducibleIntersection(type) {
|
|
55609
55556
|
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
55610
55557
|
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
55611
55558
|
}
|
|
55612
55559
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
55613
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
55560
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsNeverIntersection */) {
|
|
55614
55561
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
55615
55562
|
if (neverProp) {
|
|
55616
55563
|
return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(
|
|
@@ -56396,7 +56343,7 @@ function createTypeChecker(host) {
|
|
|
56396
56343
|
result |= getObjectFlags(type);
|
|
56397
56344
|
}
|
|
56398
56345
|
}
|
|
56399
|
-
return result &
|
|
56346
|
+
return result & 917504 /* PropagatingFlags */;
|
|
56400
56347
|
}
|
|
56401
56348
|
function tryCreateTypeReference(target, typeArguments) {
|
|
56402
56349
|
if (some(typeArguments) && target === emptyGenericType) {
|
|
@@ -56483,7 +56430,7 @@ function createTypeChecker(host) {
|
|
|
56483
56430
|
return errorType;
|
|
56484
56431
|
}
|
|
56485
56432
|
}
|
|
56486
|
-
if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
56433
|
+
if (node.kind === 183 /* TypeReference */ && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length))) {
|
|
56487
56434
|
return createDeferredTypeReference(
|
|
56488
56435
|
type,
|
|
56489
56436
|
node,
|
|
@@ -56496,23 +56443,6 @@ function createTypeChecker(host) {
|
|
|
56496
56443
|
}
|
|
56497
56444
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
56498
56445
|
}
|
|
56499
|
-
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
56500
|
-
const type = getDeclaredTypeOfSymbol(symbol);
|
|
56501
|
-
if (type === intrinsicMarkerType) {
|
|
56502
|
-
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
56503
|
-
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
56504
|
-
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
56505
|
-
}
|
|
56506
|
-
}
|
|
56507
|
-
const links = getSymbolLinks(symbol);
|
|
56508
|
-
const typeParameters = links.typeParameters;
|
|
56509
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
56510
|
-
let instantiation = links.instantiations.get(id);
|
|
56511
|
-
if (!instantiation) {
|
|
56512
|
-
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
56513
|
-
}
|
|
56514
|
-
return instantiation;
|
|
56515
|
-
}
|
|
56516
56446
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
56517
56447
|
if (getCheckFlags(symbol) & 1048576 /* Unresolved */) {
|
|
56518
56448
|
const typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
@@ -56563,10 +56493,13 @@ function createTypeChecker(host) {
|
|
|
56563
56493
|
const resolved = resolveAlias(aliasSymbol2);
|
|
56564
56494
|
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
56565
56495
|
newAliasSymbol = resolved;
|
|
56566
|
-
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node)
|
|
56496
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) ?? [];
|
|
56567
56497
|
}
|
|
56568
56498
|
}
|
|
56569
56499
|
}
|
|
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
|
+
}
|
|
56570
56503
|
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
|
|
56571
56504
|
}
|
|
56572
56505
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
@@ -56576,6 +56509,43 @@ function createTypeChecker(host) {
|
|
|
56576
56509
|
const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias);
|
|
56577
56510
|
return !!(declaration && getContainingFunction(declaration));
|
|
56578
56511
|
}
|
|
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
|
+
}
|
|
56579
56549
|
function getTypeReferenceName(node) {
|
|
56580
56550
|
switch (node.kind) {
|
|
56581
56551
|
case 183 /* TypeReference */:
|
|
@@ -57267,7 +57237,7 @@ function createTypeChecker(host) {
|
|
|
57267
57237
|
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
57268
57238
|
}
|
|
57269
57239
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
57270
|
-
return
|
|
57240
|
+
return isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
57271
57241
|
}
|
|
57272
57242
|
function isResolvedByTypeAlias(node) {
|
|
57273
57243
|
const parent = node.parent;
|
|
@@ -57322,7 +57292,7 @@ function createTypeChecker(host) {
|
|
|
57322
57292
|
const target = getArrayOrTupleTargetType(node);
|
|
57323
57293
|
if (target === emptyGenericType) {
|
|
57324
57294
|
links.resolvedType = emptyObjectType;
|
|
57325
|
-
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
|
|
57295
|
+
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node))) {
|
|
57326
57296
|
links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(
|
|
57327
57297
|
target,
|
|
57328
57298
|
node,
|
|
@@ -57542,12 +57512,12 @@ function createTypeChecker(host) {
|
|
|
57542
57512
|
includes |= flags & 473694207 /* IncludesMask */;
|
|
57543
57513
|
if (flags & 465829888 /* Instantiable */)
|
|
57544
57514
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
57545
|
-
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57515
|
+
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */)
|
|
57546
57516
|
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
57547
57517
|
if (type === wildcardType)
|
|
57548
57518
|
includes |= 8388608 /* IncludesWildcard */;
|
|
57549
57519
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
57550
|
-
if (!(getObjectFlags(type) &
|
|
57520
|
+
if (!(getObjectFlags(type) & 131072 /* ContainsWideningType */))
|
|
57551
57521
|
includes |= 4194304 /* IncludesNonWideningType */;
|
|
57552
57522
|
} else {
|
|
57553
57523
|
const len = typeSet.length;
|
|
@@ -57654,7 +57624,7 @@ function createTypeChecker(host) {
|
|
|
57654
57624
|
function removeConstrainedTypeVariables(types) {
|
|
57655
57625
|
const typeVariables = [];
|
|
57656
57626
|
for (const type of types) {
|
|
57657
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57627
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
57658
57628
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57659
57629
|
pushIfUnique(typeVariables, type.types[index]);
|
|
57660
57630
|
}
|
|
@@ -57662,7 +57632,7 @@ function createTypeChecker(host) {
|
|
|
57662
57632
|
for (const typeVariable of typeVariables) {
|
|
57663
57633
|
const primitives = [];
|
|
57664
57634
|
for (const type of types) {
|
|
57665
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57635
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
57666
57636
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57667
57637
|
if (type.types[index] === typeVariable) {
|
|
57668
57638
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -57675,7 +57645,7 @@ function createTypeChecker(host) {
|
|
|
57675
57645
|
while (i > 0) {
|
|
57676
57646
|
i--;
|
|
57677
57647
|
const type = types[i];
|
|
57678
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57648
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
57679
57649
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57680
57650
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
57681
57651
|
orderedRemoveItemAt(types, i);
|
|
@@ -57784,7 +57754,7 @@ function createTypeChecker(host) {
|
|
|
57784
57754
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
57785
57755
|
}
|
|
57786
57756
|
}
|
|
57787
|
-
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 :
|
|
57757
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
|
|
57788
57758
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
57789
57759
|
}
|
|
57790
57760
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -57935,14 +57905,14 @@ function createTypeChecker(host) {
|
|
|
57935
57905
|
}
|
|
57936
57906
|
function intersectUnionsOfPrimitiveTypes(types) {
|
|
57937
57907
|
let unionTypes2;
|
|
57938
|
-
const index = findIndex(types, (t) => !!(getObjectFlags(t) &
|
|
57908
|
+
const index = findIndex(types, (t) => !!(getObjectFlags(t) & 65536 /* PrimitiveUnion */));
|
|
57939
57909
|
if (index < 0) {
|
|
57940
57910
|
return false;
|
|
57941
57911
|
}
|
|
57942
57912
|
let i = index + 1;
|
|
57943
57913
|
while (i < types.length) {
|
|
57944
57914
|
const t = types[i];
|
|
57945
|
-
if (getObjectFlags(t) &
|
|
57915
|
+
if (getObjectFlags(t) & 65536 /* PrimitiveUnion */) {
|
|
57946
57916
|
(unionTypes2 || (unionTypes2 = [types[index]])).push(t);
|
|
57947
57917
|
orderedRemoveItemAt(types, i);
|
|
57948
57918
|
} else {
|
|
@@ -57963,7 +57933,7 @@ function createTypeChecker(host) {
|
|
|
57963
57933
|
}
|
|
57964
57934
|
}
|
|
57965
57935
|
}
|
|
57966
|
-
types[index] = getUnionTypeFromSortedList(result,
|
|
57936
|
+
types[index] = getUnionTypeFromSortedList(result, 65536 /* PrimitiveUnion */);
|
|
57967
57937
|
return true;
|
|
57968
57938
|
}
|
|
57969
57939
|
function createIntersectionType(types, objectFlags, aliasSymbol, aliasTypeArguments) {
|
|
@@ -58026,7 +57996,7 @@ function createTypeChecker(host) {
|
|
|
58026
57996
|
return neverType;
|
|
58027
57997
|
}
|
|
58028
57998
|
}
|
|
58029
|
-
objectFlags =
|
|
57999
|
+
objectFlags = 134217728 /* IsConstrainedTypeVariable */;
|
|
58030
58000
|
}
|
|
58031
58001
|
}
|
|
58032
58002
|
}
|
|
@@ -58379,7 +58349,7 @@ function createTypeChecker(host) {
|
|
|
58379
58349
|
if (noImplicitAny) {
|
|
58380
58350
|
return false;
|
|
58381
58351
|
}
|
|
58382
|
-
if (getObjectFlags(type) &
|
|
58352
|
+
if (getObjectFlags(type) & 8192 /* JSLiteral */) {
|
|
58383
58353
|
return true;
|
|
58384
58354
|
}
|
|
58385
58355
|
if (type.flags & 1048576 /* Union */) {
|
|
@@ -58627,28 +58597,28 @@ function createTypeChecker(host) {
|
|
|
58627
58597
|
return !!getGenericObjectFlags(type);
|
|
58628
58598
|
}
|
|
58629
58599
|
function isGenericObjectType(type) {
|
|
58630
|
-
return !!(getGenericObjectFlags(type) &
|
|
58600
|
+
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericObjectType */);
|
|
58631
58601
|
}
|
|
58632
58602
|
function isGenericIndexType(type) {
|
|
58633
|
-
return !!(getGenericObjectFlags(type) &
|
|
58603
|
+
return !!(getGenericObjectFlags(type) & 16777216 /* IsGenericIndexType */);
|
|
58634
58604
|
}
|
|
58635
58605
|
function getGenericObjectFlags(type) {
|
|
58636
58606
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
58637
|
-
if (!(type.objectFlags &
|
|
58638
|
-
type.objectFlags |=
|
|
58607
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
58608
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
58639
58609
|
}
|
|
58640
|
-
return type.objectFlags &
|
|
58610
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
58641
58611
|
}
|
|
58642
58612
|
if (type.flags & 33554432 /* Substitution */) {
|
|
58643
|
-
if (!(type.objectFlags &
|
|
58644
|
-
type.objectFlags |=
|
|
58613
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
58614
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | getGenericObjectFlags(type.baseType) | getGenericObjectFlags(type.constraint);
|
|
58645
58615
|
}
|
|
58646
|
-
return type.objectFlags &
|
|
58616
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
58647
58617
|
}
|
|
58648
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ?
|
|
58618
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(getResolvedType(type)) || isGenericTupleType(type) ? 8388608 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 16777216 /* IsGenericIndexType */ : 0);
|
|
58649
58619
|
}
|
|
58650
58620
|
function getSimplifiedType(type, writing) {
|
|
58651
|
-
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
58621
|
+
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : getResolvedType(type);
|
|
58652
58622
|
}
|
|
58653
58623
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
58654
58624
|
if (objectType.flags & 1048576 /* Union */ || objectType.flags & 2097152 /* Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
@@ -59148,7 +59118,7 @@ function createTypeChecker(host) {
|
|
|
59148
59118
|
}
|
|
59149
59119
|
}
|
|
59150
59120
|
const spread = createAnonymousType(type2.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type2));
|
|
59151
|
-
spread.objectFlags |=
|
|
59121
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
59152
59122
|
return spread;
|
|
59153
59123
|
}
|
|
59154
59124
|
}
|
|
@@ -59225,7 +59195,7 @@ function createTypeChecker(host) {
|
|
|
59225
59195
|
}
|
|
59226
59196
|
}
|
|
59227
59197
|
const spread = createAnonymousType(symbol, members, emptyArray, emptyArray, sameMap(indexInfos, (info) => getIndexInfoWithReadonly(info, readonly)));
|
|
59228
|
-
spread.objectFlags |=
|
|
59198
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */ | 4194304 /* ContainsSpread */ | objectFlags;
|
|
59229
59199
|
return spread;
|
|
59230
59200
|
}
|
|
59231
59201
|
function isSpreadableProperty(prop) {
|
|
@@ -59646,9 +59616,9 @@ function createTypeChecker(host) {
|
|
|
59646
59616
|
return result;
|
|
59647
59617
|
}
|
|
59648
59618
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
59649
|
-
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags &
|
|
59619
|
+
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 16777216 /* InstantiationExpressionType */ ? type.node : type.objectFlags & 64 /* TypeAliasInstantiation */ ? type.node : type.symbol.declarations[0];
|
|
59650
59620
|
const links = getNodeLinks(declaration);
|
|
59651
|
-
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags &
|
|
59621
|
+
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 128 /* Instantiated */ ? type.target : type;
|
|
59652
59622
|
let typeParameters = links.outerTypeParameters;
|
|
59653
59623
|
if (!typeParameters) {
|
|
59654
59624
|
let outerTypeParameters = getOuterTypeParameters(
|
|
@@ -59661,8 +59631,8 @@ function createTypeChecker(host) {
|
|
|
59661
59631
|
outerTypeParameters = addRange(outerTypeParameters, templateTagParameters);
|
|
59662
59632
|
}
|
|
59663
59633
|
typeParameters = outerTypeParameters || emptyArray;
|
|
59664
|
-
const allDeclarations = type.objectFlags & (4 /* Reference */ |
|
|
59665
|
-
typeParameters = (target.objectFlags & (4 /* Reference */ |
|
|
59634
|
+
const allDeclarations = type.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */) ? [declaration] : type.symbol.declarations;
|
|
59635
|
+
typeParameters = (target.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ? filter(typeParameters, (tp) => some(allDeclarations, (d) => isTypeParameterPossiblyReferenced(tp, d))) : typeParameters;
|
|
59666
59636
|
links.outerTypeParameters = typeParameters;
|
|
59667
59637
|
}
|
|
59668
59638
|
if (typeParameters.length) {
|
|
@@ -59681,13 +59651,13 @@ function createTypeChecker(host) {
|
|
|
59681
59651
|
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);
|
|
59682
59652
|
target.instantiations.set(id, result);
|
|
59683
59653
|
const resultObjectFlags = getObjectFlags(result);
|
|
59684
|
-
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags &
|
|
59654
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
59685
59655
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
59686
|
-
if (!(getObjectFlags(result) &
|
|
59656
|
+
if (!(getObjectFlags(result) & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
59687
59657
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
59688
|
-
result.objectFlags |=
|
|
59658
|
+
result.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
59689
59659
|
} else {
|
|
59690
|
-
result.objectFlags |= !resultCouldContainTypeVariables ?
|
|
59660
|
+
result.objectFlags |= !resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariablesComputed */ : 0;
|
|
59691
59661
|
}
|
|
59692
59662
|
}
|
|
59693
59663
|
}
|
|
@@ -59817,8 +59787,7 @@ function createTypeChecker(host) {
|
|
|
59817
59787
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
59818
59788
|
}
|
|
59819
59789
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
59820
|
-
|
|
59821
|
-
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
59790
|
+
const result = createObjectType(type.objectFlags & ~(1048576 /* CouldContainTypeVariablesComputed */ | 2097152 /* CouldContainTypeVariables */) | 128 /* Instantiated */, type.symbol);
|
|
59822
59791
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
59823
59792
|
result.declaration = type.declaration;
|
|
59824
59793
|
const origTypeParameter = getTypeParameterFromMappedType(type);
|
|
@@ -59826,8 +59795,10 @@ function createTypeChecker(host) {
|
|
|
59826
59795
|
result.typeParameter = freshTypeParameter;
|
|
59827
59796
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
59828
59797
|
freshTypeParameter.mapper = mapper;
|
|
59829
|
-
}
|
|
59830
|
-
|
|
59798
|
+
} else if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
|
|
59799
|
+
result.node = type.node;
|
|
59800
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
59801
|
+
result.typeAlias = type.typeAlias;
|
|
59831
59802
|
result.node = type.node;
|
|
59832
59803
|
}
|
|
59833
59804
|
result.target = type;
|
|
@@ -59888,13 +59859,13 @@ function createTypeChecker(host) {
|
|
|
59888
59859
|
}
|
|
59889
59860
|
if (flags & 524288 /* Object */) {
|
|
59890
59861
|
const objectFlags = type.objectFlags;
|
|
59891
|
-
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */)) {
|
|
59862
|
+
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */ | 64 /* TypeAliasInstantiation */)) {
|
|
59892
59863
|
if (objectFlags & 4 /* Reference */ && !type.node) {
|
|
59893
59864
|
const resolvedTypeArguments = type.resolvedTypeArguments;
|
|
59894
59865
|
const newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper);
|
|
59895
59866
|
return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type;
|
|
59896
59867
|
}
|
|
59897
|
-
if (objectFlags &
|
|
59868
|
+
if (objectFlags & 2048 /* ReverseMapped */) {
|
|
59898
59869
|
return instantiateReverseMappedType(type, mapper);
|
|
59899
59870
|
}
|
|
59900
59871
|
return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments);
|
|
@@ -60830,11 +60801,11 @@ function createTypeChecker(host) {
|
|
|
60830
60801
|
}
|
|
60831
60802
|
function isUnknownLikeUnionType(type) {
|
|
60832
60803
|
if (strictNullChecks && type.flags & 1048576 /* Union */) {
|
|
60833
|
-
if (!(type.objectFlags &
|
|
60804
|
+
if (!(type.objectFlags & 67108864 /* IsUnknownLikeUnionComputed */)) {
|
|
60834
60805
|
const types = type.types;
|
|
60835
|
-
type.objectFlags |=
|
|
60806
|
+
type.objectFlags |= 67108864 /* IsUnknownLikeUnionComputed */ | (types.length >= 3 && types[0].flags & 32768 /* Undefined */ && types[1].flags & 65536 /* Null */ && some(types, isEmptyAnonymousObjectType) ? 134217728 /* IsUnknownLikeUnion */ : 0);
|
|
60836
60807
|
}
|
|
60837
|
-
return !!(type.objectFlags &
|
|
60808
|
+
return !!(type.objectFlags & 134217728 /* IsUnknownLikeUnion */);
|
|
60838
60809
|
}
|
|
60839
60810
|
return false;
|
|
60840
60811
|
}
|
|
@@ -60945,7 +60916,7 @@ function createTypeChecker(host) {
|
|
|
60945
60916
|
return true;
|
|
60946
60917
|
if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */))
|
|
60947
60918
|
return true;
|
|
60948
|
-
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) &
|
|
60919
|
+
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) & 16384 /* FreshLiteral */)))
|
|
60949
60920
|
return true;
|
|
60950
60921
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
60951
60922
|
if (s & 1 /* Any */)
|
|
@@ -61004,11 +60975,11 @@ function createTypeChecker(host) {
|
|
|
61004
60975
|
return false;
|
|
61005
60976
|
}
|
|
61006
60977
|
function isIgnoredJsxProperty(source, sourceProp) {
|
|
61007
|
-
return getObjectFlags(source) &
|
|
60978
|
+
return getObjectFlags(source) & 4096 /* JsxAttributes */ && isHyphenatedJsxName(sourceProp.escapedName);
|
|
61008
60979
|
}
|
|
61009
60980
|
function getNormalizedType(type, writing) {
|
|
61010
60981
|
while (true) {
|
|
61011
|
-
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;
|
|
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 : getObjectFlags(type) & 64 /* TypeAliasInstantiation */ ? getResolvedTypeAliasInstantiation(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;
|
|
61012
60983
|
if (t === type)
|
|
61013
60984
|
return t;
|
|
61014
60985
|
type = t;
|
|
@@ -61398,7 +61369,7 @@ function createTypeChecker(host) {
|
|
|
61398
61369
|
if (relation === comparableRelation && !(target2.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0))
|
|
61399
61370
|
return -1 /* True */;
|
|
61400
61371
|
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
61401
|
-
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source2) && getObjectFlags(source2) &
|
|
61372
|
+
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */);
|
|
61402
61373
|
if (isPerformingExcessPropertyChecks) {
|
|
61403
61374
|
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
61404
61375
|
if (reportErrors2) {
|
|
@@ -61408,7 +61379,7 @@ function createTypeChecker(host) {
|
|
|
61408
61379
|
}
|
|
61409
61380
|
}
|
|
61410
61381
|
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));
|
|
61411
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
61382
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
61412
61383
|
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) {
|
|
61413
61384
|
if (reportErrors2) {
|
|
61414
61385
|
const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2);
|
|
@@ -61473,7 +61444,7 @@ function createTypeChecker(host) {
|
|
|
61473
61444
|
tryElaborateErrorsForPrimitivesAndObjects(source2, target2);
|
|
61474
61445
|
} else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) {
|
|
61475
61446
|
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
61476
|
-
} else if (getObjectFlags(source2) &
|
|
61447
|
+
} else if (getObjectFlags(source2) & 4096 /* JsxAttributes */ && target2.flags & 2097152 /* Intersection */) {
|
|
61477
61448
|
const targetTypes = target2.types;
|
|
61478
61449
|
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
61479
61450
|
const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
@@ -61504,7 +61475,7 @@ function createTypeChecker(host) {
|
|
|
61504
61475
|
if (source2.flags & 3145728 /* UnionOrIntersection */ && target2.flags & 3145728 /* UnionOrIntersection */) {
|
|
61505
61476
|
const sourceUnionOrIntersection = source2;
|
|
61506
61477
|
const targetUnionOrIntersection = target2;
|
|
61507
|
-
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags &
|
|
61478
|
+
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 65536 /* PrimitiveUnion */) {
|
|
61508
61479
|
return;
|
|
61509
61480
|
}
|
|
61510
61481
|
const sourceSize = sourceUnionOrIntersection.types.length;
|
|
@@ -61538,10 +61509,10 @@ function createTypeChecker(host) {
|
|
|
61538
61509
|
}
|
|
61539
61510
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
61540
61511
|
var _a2;
|
|
61541
|
-
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) &
|
|
61512
|
+
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 8192 /* JSLiteral */) {
|
|
61542
61513
|
return false;
|
|
61543
61514
|
}
|
|
61544
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
61515
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
61545
61516
|
if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) {
|
|
61546
61517
|
return false;
|
|
61547
61518
|
}
|
|
@@ -61680,7 +61651,7 @@ function createTypeChecker(host) {
|
|
|
61680
61651
|
if (containsType(targetTypes, source2)) {
|
|
61681
61652
|
return -1 /* True */;
|
|
61682
61653
|
}
|
|
61683
|
-
if (relation !== comparableRelation && getObjectFlags(target2) &
|
|
61654
|
+
if (relation !== comparableRelation && getObjectFlags(target2) & 65536 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
|
|
61684
61655
|
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
61685
61656
|
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
61686
61657
|
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
@@ -62084,7 +62055,7 @@ function createTypeChecker(host) {
|
|
|
62084
62055
|
false,
|
|
62085
62056
|
0 /* None */
|
|
62086
62057
|
);
|
|
62087
|
-
if (result2 && isObjectLiteralType(source2) && getObjectFlags(source2) &
|
|
62058
|
+
if (result2 && isObjectLiteralType(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */) {
|
|
62088
62059
|
result2 &= indexSignaturesRelatedTo(
|
|
62089
62060
|
source2,
|
|
62090
62061
|
target2,
|
|
@@ -62094,7 +62065,7 @@ function createTypeChecker(host) {
|
|
|
62094
62065
|
0 /* None */
|
|
62095
62066
|
);
|
|
62096
62067
|
}
|
|
62097
|
-
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) &
|
|
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) & 524288 /* NonInferrableType */))) {
|
|
62098
62069
|
result2 &= propertiesRelatedTo(
|
|
62099
62070
|
source2,
|
|
62100
62071
|
target2,
|
|
@@ -62595,7 +62566,7 @@ function createTypeChecker(host) {
|
|
|
62595
62566
|
if (constraint !== source2) {
|
|
62596
62567
|
return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2);
|
|
62597
62568
|
}
|
|
62598
|
-
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) &
|
|
62569
|
+
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 16384 /* FreshLiteral */ && !isEmptyObjectType(source2)) {
|
|
62599
62570
|
return 0 /* False */;
|
|
62600
62571
|
}
|
|
62601
62572
|
if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
|
|
@@ -63127,7 +63098,7 @@ function createTypeChecker(host) {
|
|
|
63127
63098
|
const incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
63128
63099
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
63129
63100
|
const targetObjectFlags = getObjectFlags(target2);
|
|
63130
|
-
if (sourceObjectFlags &
|
|
63101
|
+
if (sourceObjectFlags & 128 /* Instantiated */ && targetObjectFlags & 128 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
63131
63102
|
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
63132
63103
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
63133
63104
|
const related = signatureRelatedTo(
|
|
@@ -63343,7 +63314,7 @@ function createTypeChecker(host) {
|
|
|
63343
63314
|
if (sourceInfo) {
|
|
63344
63315
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
63345
63316
|
}
|
|
63346
|
-
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) &
|
|
63317
|
+
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 16384 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) {
|
|
63347
63318
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
63348
63319
|
}
|
|
63349
63320
|
if (reportErrors2) {
|
|
@@ -63617,11 +63588,11 @@ function createTypeChecker(host) {
|
|
|
63617
63588
|
}
|
|
63618
63589
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
63619
63590
|
if (depth >= maxDepth) {
|
|
63620
|
-
if ((getObjectFlags(type) &
|
|
63591
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
63621
63592
|
type = getMappedTargetWithSymbol(type);
|
|
63622
63593
|
}
|
|
63623
63594
|
if (type.flags & 2097152 /* Intersection */) {
|
|
63624
|
-
return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth));
|
|
63595
|
+
return some(type.types, (t) => isDeeplyNestedType(getResolvedType(t), stack, depth, maxDepth));
|
|
63625
63596
|
}
|
|
63626
63597
|
const identity2 = getRecursionIdentity(type);
|
|
63627
63598
|
let count = 0;
|
|
@@ -63643,17 +63614,17 @@ function createTypeChecker(host) {
|
|
|
63643
63614
|
}
|
|
63644
63615
|
function getMappedTargetWithSymbol(type) {
|
|
63645
63616
|
let target;
|
|
63646
|
-
while ((getObjectFlags(type) &
|
|
63617
|
+
while ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */ && (target = getModifiersTypeFromMappedType(type)) && (target.symbol || target.flags & 2097152 /* Intersection */ && some(target.types, (t) => !!t.symbol))) {
|
|
63647
63618
|
type = target;
|
|
63648
63619
|
}
|
|
63649
63620
|
return type;
|
|
63650
63621
|
}
|
|
63651
63622
|
function hasMatchingRecursionIdentity(type, identity2) {
|
|
63652
|
-
if ((getObjectFlags(type) &
|
|
63623
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
63653
63624
|
type = getMappedTargetWithSymbol(type);
|
|
63654
63625
|
}
|
|
63655
63626
|
if (type.flags & 2097152 /* Intersection */) {
|
|
63656
|
-
return some(type.types, (t) => hasMatchingRecursionIdentity(t, identity2));
|
|
63627
|
+
return some(type.types, (t) => hasMatchingRecursionIdentity(getResolvedType(t), identity2));
|
|
63657
63628
|
}
|
|
63658
63629
|
return getRecursionIdentity(type) === identity2;
|
|
63659
63630
|
}
|
|
@@ -63836,10 +63807,10 @@ function createTypeChecker(host) {
|
|
|
63836
63807
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
63837
63808
|
return void 0;
|
|
63838
63809
|
}
|
|
63839
|
-
if (getObjectFlags(type) &
|
|
63840
|
-
return getObjectFlags(type) &
|
|
63810
|
+
if (getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
|
|
63811
|
+
return getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : void 0;
|
|
63841
63812
|
}
|
|
63842
|
-
type.objectFlags |=
|
|
63813
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
|
|
63843
63814
|
const target = type.target;
|
|
63844
63815
|
if (getObjectFlags(target) & 1 /* Class */) {
|
|
63845
63816
|
const baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -63858,7 +63829,7 @@ function createTypeChecker(host) {
|
|
|
63858
63829
|
if (length(getTypeArguments(type)) > length(target.typeParameters)) {
|
|
63859
63830
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, last(getTypeArguments(type)));
|
|
63860
63831
|
}
|
|
63861
|
-
type.objectFlags |=
|
|
63832
|
+
type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
|
|
63862
63833
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
63863
63834
|
}
|
|
63864
63835
|
function isEmptyLiteralType(type) {
|
|
@@ -64043,7 +64014,7 @@ function createTypeChecker(host) {
|
|
|
64043
64014
|
}
|
|
64044
64015
|
function isObjectTypeWithInferableIndex(type) {
|
|
64045
64016
|
const objectFlags = getObjectFlags(type);
|
|
64046
|
-
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 &
|
|
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 & 8388608 /* ObjectRestType */) || !!(objectFlags & 2048 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source));
|
|
64047
64018
|
}
|
|
64048
64019
|
function createSymbolWithType(source, type) {
|
|
64049
64020
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
@@ -64070,7 +64041,7 @@ function createTypeChecker(host) {
|
|
|
64070
64041
|
return members;
|
|
64071
64042
|
}
|
|
64072
64043
|
function getRegularTypeOfObjectLiteral(type) {
|
|
64073
|
-
if (!(isObjectLiteralType(type) && getObjectFlags(type) &
|
|
64044
|
+
if (!(isObjectLiteralType(type) && getObjectFlags(type) & 16384 /* FreshLiteral */)) {
|
|
64074
64045
|
return type;
|
|
64075
64046
|
}
|
|
64076
64047
|
const regularType = type.regularType;
|
|
@@ -64081,7 +64052,7 @@ function createTypeChecker(host) {
|
|
|
64081
64052
|
const members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
|
64082
64053
|
const regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
|
|
64083
64054
|
regularNew.flags = resolved.flags;
|
|
64084
|
-
regularNew.objectFlags |= resolved.objectFlags & ~
|
|
64055
|
+
regularNew.objectFlags |= resolved.objectFlags & ~16384 /* FreshLiteral */;
|
|
64085
64056
|
type.regularType = regularNew;
|
|
64086
64057
|
return regularNew;
|
|
64087
64058
|
}
|
|
@@ -64109,7 +64080,7 @@ function createTypeChecker(host) {
|
|
|
64109
64080
|
if (!context.resolvedProperties) {
|
|
64110
64081
|
const names = /* @__PURE__ */ new Map();
|
|
64111
64082
|
for (const t of getSiblingsOfContext(context)) {
|
|
64112
|
-
if (isObjectLiteralType(t) && !(getObjectFlags(t) &
|
|
64083
|
+
if (isObjectLiteralType(t) && !(getObjectFlags(t) & 4194304 /* ContainsSpread */)) {
|
|
64113
64084
|
for (const prop of getPropertiesOfType(t)) {
|
|
64114
64085
|
names.set(prop.escapedName, prop);
|
|
64115
64086
|
}
|
|
@@ -64156,7 +64127,7 @@ function createTypeChecker(host) {
|
|
|
64156
64127
|
}
|
|
64157
64128
|
}
|
|
64158
64129
|
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
64159
|
-
result.objectFlags |= getObjectFlags(type) & (
|
|
64130
|
+
result.objectFlags |= getObjectFlags(type) & (8192 /* JSLiteral */ | 524288 /* NonInferrableType */);
|
|
64160
64131
|
return result;
|
|
64161
64132
|
}
|
|
64162
64133
|
function getWidenedType(type) {
|
|
@@ -64167,7 +64138,7 @@ function createTypeChecker(host) {
|
|
|
64167
64138
|
);
|
|
64168
64139
|
}
|
|
64169
64140
|
function getWidenedTypeWithContext(type, context) {
|
|
64170
|
-
if (getObjectFlags(type) &
|
|
64141
|
+
if (getObjectFlags(type) & 393216 /* RequiresWidening */) {
|
|
64171
64142
|
if (context === void 0 && type.widened) {
|
|
64172
64143
|
return type.widened;
|
|
64173
64144
|
}
|
|
@@ -64200,7 +64171,7 @@ function createTypeChecker(host) {
|
|
|
64200
64171
|
}
|
|
64201
64172
|
function reportWideningErrorsInType(type) {
|
|
64202
64173
|
let errorReported = false;
|
|
64203
|
-
if (getObjectFlags(type) &
|
|
64174
|
+
if (getObjectFlags(type) & 131072 /* ContainsWideningType */) {
|
|
64204
64175
|
if (type.flags & 1048576 /* Union */) {
|
|
64205
64176
|
if (some(type.types, isEmptyObjectType)) {
|
|
64206
64177
|
errorReported = true;
|
|
@@ -64222,7 +64193,7 @@ function createTypeChecker(host) {
|
|
|
64222
64193
|
if (isObjectLiteralType(type)) {
|
|
64223
64194
|
for (const p of getPropertiesOfObjectType(type)) {
|
|
64224
64195
|
const t = getTypeOfSymbol(p);
|
|
64225
|
-
if (getObjectFlags(t) &
|
|
64196
|
+
if (getObjectFlags(t) & 131072 /* ContainsWideningType */) {
|
|
64226
64197
|
if (!reportWideningErrorsInType(t)) {
|
|
64227
64198
|
error(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
|
|
64228
64199
|
}
|
|
@@ -64310,7 +64281,7 @@ function createTypeChecker(host) {
|
|
|
64310
64281
|
}
|
|
64311
64282
|
function reportErrorsFromWidening(declaration, type, wideningKind) {
|
|
64312
64283
|
addLazyDiagnostic(() => {
|
|
64313
|
-
if (noImplicitAny && getObjectFlags(type) &
|
|
64284
|
+
if (noImplicitAny && getObjectFlags(type) & 131072 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
64314
64285
|
if (!reportWideningErrorsInType(type)) {
|
|
64315
64286
|
reportImplicitAny(declaration, type, wideningKind);
|
|
64316
64287
|
}
|
|
@@ -64447,12 +64418,12 @@ function createTypeChecker(host) {
|
|
|
64447
64418
|
}
|
|
64448
64419
|
function couldContainTypeVariables(type) {
|
|
64449
64420
|
const objectFlags = getObjectFlags(type);
|
|
64450
|
-
if (objectFlags &
|
|
64451
|
-
return !!(objectFlags &
|
|
64421
|
+
if (objectFlags & 1048576 /* CouldContainTypeVariablesComputed */) {
|
|
64422
|
+
return !!(objectFlags & 2097152 /* CouldContainTypeVariables */);
|
|
64452
64423
|
}
|
|
64453
|
-
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 */ |
|
|
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 */ | 2048 /* ReverseMapped */ | 8388608 /* ObjectRestType */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
64454
64425
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
64455
|
-
type.objectFlags |=
|
|
64426
|
+
type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
64456
64427
|
}
|
|
64457
64428
|
return result;
|
|
64458
64429
|
}
|
|
@@ -64516,7 +64487,7 @@ function createTypeChecker(host) {
|
|
|
64516
64487
|
return type;
|
|
64517
64488
|
}
|
|
64518
64489
|
function isPartiallyInferableType(type) {
|
|
64519
|
-
return !(getObjectFlags(type) &
|
|
64490
|
+
return !(getObjectFlags(type) & 524288 /* NonInferrableType */) || isObjectLiteralType(type) && some(getPropertiesOfType(type), (prop) => isPartiallyInferableType(getTypeOfSymbol(prop))) || isTupleType(type) && some(getElementTypes(type), isPartiallyInferableType);
|
|
64520
64491
|
}
|
|
64521
64492
|
function createReverseMappedType(source, target, constraint) {
|
|
64522
64493
|
if (!(getIndexInfoOfType(source, stringType) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {
|
|
@@ -64531,7 +64502,7 @@ function createTypeChecker(host) {
|
|
|
64531
64502
|
return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations);
|
|
64532
64503
|
}
|
|
64533
64504
|
const reversed = createObjectType(
|
|
64534
|
-
|
|
64505
|
+
2048 /* ReverseMapped */ | 16 /* Anonymous */,
|
|
64535
64506
|
/*symbol*/
|
|
64536
64507
|
void 0
|
|
64537
64508
|
);
|
|
@@ -64752,6 +64723,8 @@ function createTypeChecker(host) {
|
|
|
64752
64723
|
propagationType = savePropagationType;
|
|
64753
64724
|
return;
|
|
64754
64725
|
}
|
|
64726
|
+
source = getResolvedType(source);
|
|
64727
|
+
target = getResolvedType(target);
|
|
64755
64728
|
if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
|
|
64756
64729
|
if (source.aliasTypeArguments) {
|
|
64757
64730
|
const params = getSymbolLinks(source.aliasSymbol).typeParameters;
|
|
@@ -64802,7 +64775,7 @@ function createTypeChecker(host) {
|
|
|
64802
64775
|
}
|
|
64803
64776
|
const inference = getInferenceInfoForType(target);
|
|
64804
64777
|
if (inference) {
|
|
64805
|
-
if (getObjectFlags(source) &
|
|
64778
|
+
if (getObjectFlags(source) & 524288 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
64806
64779
|
return;
|
|
64807
64780
|
}
|
|
64808
64781
|
if (!inference.isFixed) {
|
|
@@ -65086,7 +65059,7 @@ function createTypeChecker(host) {
|
|
|
65086
65059
|
inferWithPriority(
|
|
65087
65060
|
inferredType,
|
|
65088
65061
|
inference.typeParameter,
|
|
65089
|
-
getObjectFlags(source) &
|
|
65062
|
+
getObjectFlags(source) & 524288 /* NonInferrableType */ ? 16 /* PartialHomomorphicMappedType */ : 8 /* HomomorphicMappedType */
|
|
65090
65063
|
);
|
|
65091
65064
|
}
|
|
65092
65065
|
}
|
|
@@ -65341,10 +65314,10 @@ function createTypeChecker(host) {
|
|
|
65341
65314
|
return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 402784252 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
|
|
65342
65315
|
}
|
|
65343
65316
|
function isObjectLiteralType(type) {
|
|
65344
|
-
return !!(getObjectFlags(type) &
|
|
65317
|
+
return !!(getObjectFlags(type) & 256 /* ObjectLiteral */);
|
|
65345
65318
|
}
|
|
65346
65319
|
function isObjectOrArrayLiteralType(type) {
|
|
65347
|
-
return !!(getObjectFlags(type) & (
|
|
65320
|
+
return !!(getObjectFlags(type) & (256 /* ObjectLiteral */ | 32768 /* ArrayLiteral */));
|
|
65348
65321
|
}
|
|
65349
65322
|
function unionObjectAndArrayLiteralCandidates(candidates) {
|
|
65350
65323
|
if (candidates.length > 1) {
|
|
@@ -65672,7 +65645,7 @@ function createTypeChecker(host) {
|
|
|
65672
65645
|
}
|
|
65673
65646
|
function getKeyPropertyName(unionType) {
|
|
65674
65647
|
const types = unionType.types;
|
|
65675
|
-
if (types.length < 10 || getObjectFlags(unionType) &
|
|
65648
|
+
if (types.length < 10 || getObjectFlags(unionType) & 65536 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */))) < 10) {
|
|
65676
65649
|
return void 0;
|
|
65677
65650
|
}
|
|
65678
65651
|
if (unionType.keyPropertyName === void 0) {
|
|
@@ -66061,7 +66034,7 @@ function createTypeChecker(host) {
|
|
|
66061
66034
|
}
|
|
66062
66035
|
return getUnionTypeFromSortedList(
|
|
66063
66036
|
filtered,
|
|
66064
|
-
type.objectFlags & (
|
|
66037
|
+
type.objectFlags & (65536 /* PrimitiveUnion */ | 33554432 /* ContainsIntersections */),
|
|
66065
66038
|
/*aliasSymbol*/
|
|
66066
66039
|
void 0,
|
|
66067
66040
|
/*aliasTypeArguments*/
|
|
@@ -66123,7 +66096,7 @@ function createTypeChecker(host) {
|
|
|
66123
66096
|
return incomplete ? { flags: 0, type: type.flags & 131072 /* Never */ ? silentNeverType : type } : type;
|
|
66124
66097
|
}
|
|
66125
66098
|
function createEvolvingArrayType(elementType) {
|
|
66126
|
-
const result = createObjectType(
|
|
66099
|
+
const result = createObjectType(512 /* EvolvingArray */);
|
|
66127
66100
|
result.elementType = elementType;
|
|
66128
66101
|
return result;
|
|
66129
66102
|
}
|
|
@@ -66143,16 +66116,16 @@ function createTypeChecker(host) {
|
|
|
66143
66116
|
return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
|
|
66144
66117
|
}
|
|
66145
66118
|
function finalizeEvolvingArrayType(type) {
|
|
66146
|
-
return getObjectFlags(type) &
|
|
66119
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? getFinalArrayType(type) : type;
|
|
66147
66120
|
}
|
|
66148
66121
|
function getElementTypeOfEvolvingArrayType(type) {
|
|
66149
|
-
return getObjectFlags(type) &
|
|
66122
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? type.elementType : neverType;
|
|
66150
66123
|
}
|
|
66151
66124
|
function isEvolvingArrayTypeList(types) {
|
|
66152
66125
|
let hasEvolvingArrayType = false;
|
|
66153
66126
|
for (const t of types) {
|
|
66154
66127
|
if (!(t.flags & 131072 /* Never */)) {
|
|
66155
|
-
if (!(getObjectFlags(t) &
|
|
66128
|
+
if (!(getObjectFlags(t) & 512 /* EvolvingArray */)) {
|
|
66156
66129
|
return false;
|
|
66157
66130
|
}
|
|
66158
66131
|
hasEvolvingArrayType = true;
|
|
@@ -66456,7 +66429,7 @@ function createTypeChecker(host) {
|
|
|
66456
66429
|
const sharedFlowStart = sharedFlowCount;
|
|
66457
66430
|
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
|
|
66458
66431
|
sharedFlowCount = sharedFlowStart;
|
|
66459
|
-
const resultType = getObjectFlags(evolvedType) &
|
|
66432
|
+
const resultType = getObjectFlags(evolvedType) & 512 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
|
|
66460
66433
|
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
|
|
66461
66434
|
return declaredType;
|
|
66462
66435
|
}
|
|
@@ -66643,7 +66616,7 @@ function createTypeChecker(host) {
|
|
|
66643
66616
|
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
|
|
66644
66617
|
const flowType = getTypeAtFlowNode(flow.antecedent);
|
|
66645
66618
|
const type = getTypeFromFlowType(flowType);
|
|
66646
|
-
if (getObjectFlags(type) &
|
|
66619
|
+
if (getObjectFlags(type) & 512 /* EvolvingArray */) {
|
|
66647
66620
|
let evolvedType2 = type;
|
|
66648
66621
|
if (node.kind === 213 /* CallExpression */) {
|
|
66649
66622
|
for (const arg of node.arguments) {
|
|
@@ -67496,7 +67469,7 @@ function createTypeChecker(host) {
|
|
|
67496
67469
|
location = location.parent;
|
|
67497
67470
|
}
|
|
67498
67471
|
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
|
|
67499
|
-
const type = removeOptionalTypeMarker(
|
|
67472
|
+
const type = getResolvedType(removeOptionalTypeMarker(
|
|
67500
67473
|
isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
|
|
67501
67474
|
location,
|
|
67502
67475
|
/*checkMode*/
|
|
@@ -67504,7 +67477,7 @@ function createTypeChecker(host) {
|
|
|
67504
67477
|
/*writeOnly*/
|
|
67505
67478
|
true
|
|
67506
67479
|
) : getTypeOfExpression(location)
|
|
67507
|
-
);
|
|
67480
|
+
));
|
|
67508
67481
|
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
|
|
67509
67482
|
return type;
|
|
67510
67483
|
}
|
|
@@ -69552,7 +69525,7 @@ function createTypeChecker(host) {
|
|
|
69552
69525
|
let literalType = type.literalType;
|
|
69553
69526
|
if (!literalType) {
|
|
69554
69527
|
literalType = type.literalType = cloneTypeReference(type);
|
|
69555
|
-
literalType.objectFlags |=
|
|
69528
|
+
literalType.objectFlags |= 32768 /* ArrayLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
69556
69529
|
}
|
|
69557
69530
|
return literalType;
|
|
69558
69531
|
}
|
|
@@ -69680,7 +69653,7 @@ function createTypeChecker(host) {
|
|
|
69680
69653
|
checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
|
|
69681
69654
|
}
|
|
69682
69655
|
}
|
|
69683
|
-
objectFlags |= getObjectFlags(type) &
|
|
69656
|
+
objectFlags |= getObjectFlags(type) & 917504 /* PropagatingFlags */;
|
|
69684
69657
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
69685
69658
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
69686
69659
|
if (nameType) {
|
|
@@ -69691,7 +69664,7 @@ function createTypeChecker(host) {
|
|
|
69691
69664
|
if (isOptional) {
|
|
69692
69665
|
prop.flags |= 16777216 /* Optional */;
|
|
69693
69666
|
}
|
|
69694
|
-
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) &
|
|
69667
|
+
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 1024 /* ObjectLiteralPatternWithComputedProperties */)) {
|
|
69695
69668
|
const impliedProp = getPropertyOfType(contextualType, member.escapedName);
|
|
69696
69669
|
if (impliedProp) {
|
|
69697
69670
|
prop.flags |= impliedProp.flags & 16777216 /* Optional */;
|
|
@@ -69803,12 +69776,12 @@ function createTypeChecker(host) {
|
|
|
69803
69776
|
if (hasComputedSymbolProperty)
|
|
69804
69777
|
indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
|
|
69805
69778
|
const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, indexInfos);
|
|
69806
|
-
result.objectFlags |= objectFlags |
|
|
69779
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
69807
69780
|
if (isJSObjectLiteral) {
|
|
69808
|
-
result.objectFlags |=
|
|
69781
|
+
result.objectFlags |= 8192 /* JSLiteral */;
|
|
69809
69782
|
}
|
|
69810
69783
|
if (patternWithComputedProperties) {
|
|
69811
|
-
result.objectFlags |=
|
|
69784
|
+
result.objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
69812
69785
|
}
|
|
69813
69786
|
if (inDestructuringPattern) {
|
|
69814
69787
|
result.pattern = node;
|
|
@@ -69870,13 +69843,13 @@ function createTypeChecker(host) {
|
|
|
69870
69843
|
let hasSpreadAnyType = false;
|
|
69871
69844
|
let typeToIntersect;
|
|
69872
69845
|
let explicitlySpecifyChildrenAttribute = false;
|
|
69873
|
-
let objectFlags =
|
|
69846
|
+
let objectFlags = 4096 /* JsxAttributes */;
|
|
69874
69847
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
|
|
69875
69848
|
for (const attributeDecl of attributes.properties) {
|
|
69876
69849
|
const member = attributeDecl.symbol;
|
|
69877
69850
|
if (isJsxAttribute(attributeDecl)) {
|
|
69878
69851
|
const exprType = checkJsxAttribute(attributeDecl, checkMode);
|
|
69879
|
-
objectFlags |= getObjectFlags(exprType) &
|
|
69852
|
+
objectFlags |= getObjectFlags(exprType) & 917504 /* PropagatingFlags */;
|
|
69880
69853
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
69881
69854
|
attributeSymbol.declarations = member.declarations;
|
|
69882
69855
|
attributeSymbol.parent = member.parent;
|
|
@@ -69997,7 +69970,7 @@ function createTypeChecker(host) {
|
|
|
69997
69970
|
function createJsxAttributesType() {
|
|
69998
69971
|
objectFlags |= freshObjectLiteralFlag;
|
|
69999
69972
|
const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, emptyArray);
|
|
70000
|
-
result.objectFlags |= objectFlags |
|
|
69973
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
70001
69974
|
return result;
|
|
70002
69975
|
}
|
|
70003
69976
|
}
|
|
@@ -70390,7 +70363,7 @@ function createTypeChecker(host) {
|
|
|
70390
70363
|
return false;
|
|
70391
70364
|
}
|
|
70392
70365
|
function isExcessPropertyCheckTarget(type) {
|
|
70393
|
-
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) &
|
|
70366
|
+
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) & 1024 /* ObjectLiteralPatternWithComputedProperties */) || type.flags & 67108864 /* NonPrimitive */ || type.flags & 1048576 /* Union */ && some(type.types, isExcessPropertyCheckTarget) || type.flags & 2097152 /* Intersection */ && every(type.types, isExcessPropertyCheckTarget));
|
|
70394
70367
|
}
|
|
70395
70368
|
function checkJsxExpression(node, checkMode) {
|
|
70396
70369
|
checkGrammarJsxExpression(node);
|
|
@@ -73158,7 +73131,7 @@ function createTypeChecker(host) {
|
|
|
73158
73131
|
);
|
|
73159
73132
|
if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) {
|
|
73160
73133
|
const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray);
|
|
73161
|
-
jsAssignmentType.objectFlags |=
|
|
73134
|
+
jsAssignmentType.objectFlags |= 8192 /* JSLiteral */;
|
|
73162
73135
|
return getIntersectionType([returnType, jsAssignmentType]);
|
|
73163
73136
|
}
|
|
73164
73137
|
}
|
|
@@ -73504,7 +73477,7 @@ function createTypeChecker(host) {
|
|
|
73504
73477
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
73505
73478
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
73506
73479
|
const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
73507
|
-
result3.objectFlags |=
|
|
73480
|
+
result3.objectFlags |= 16777216 /* InstantiationExpressionType */;
|
|
73508
73481
|
result3.node = node;
|
|
73509
73482
|
return result3;
|
|
73510
73483
|
}
|
|
@@ -74545,7 +74518,7 @@ function createTypeChecker(host) {
|
|
|
74545
74518
|
64 /* IsNonInferrable */
|
|
74546
74519
|
);
|
|
74547
74520
|
const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
|
|
74548
|
-
returnOnlyType.objectFlags |=
|
|
74521
|
+
returnOnlyType.objectFlags |= 524288 /* NonInferrableType */;
|
|
74549
74522
|
return links.contextFreeType = returnOnlyType;
|
|
74550
74523
|
}
|
|
74551
74524
|
}
|
|
@@ -82608,7 +82581,7 @@ function createTypeChecker(host) {
|
|
|
82608
82581
|
return void 0;
|
|
82609
82582
|
case 11 /* StringLiteral */:
|
|
82610
82583
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
82611
|
-
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node ||
|
|
82584
|
+
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
|
|
82612
82585
|
node.parent,
|
|
82613
82586
|
/*requireStringLiteralLikeArgument*/
|
|
82614
82587
|
false
|
|
@@ -83158,7 +83131,7 @@ function createTypeChecker(host) {
|
|
|
83158
83131
|
true,
|
|
83159
83132
|
location
|
|
83160
83133
|
);
|
|
83161
|
-
const
|
|
83134
|
+
const resolvedValueSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol;
|
|
83162
83135
|
isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */)));
|
|
83163
83136
|
const typeSymbol = resolveEntityName(
|
|
83164
83137
|
typeName,
|
|
@@ -83166,26 +83139,30 @@ function createTypeChecker(host) {
|
|
|
83166
83139
|
/*ignoreErrors*/
|
|
83167
83140
|
true,
|
|
83168
83141
|
/*dontResolveAlias*/
|
|
83169
|
-
|
|
83142
|
+
true,
|
|
83170
83143
|
location
|
|
83171
83144
|
);
|
|
83172
|
-
|
|
83145
|
+
const resolvedTypeSymbol = typeSymbol && typeSymbol.flags & 2097152 /* Alias */ ? resolveAlias(typeSymbol) : typeSymbol;
|
|
83146
|
+
if (!valueSymbol) {
|
|
83147
|
+
isTypeOnly || (isTypeOnly = !!(typeSymbol && getTypeOnlyAliasDeclaration(typeSymbol, 788968 /* Type */)));
|
|
83148
|
+
}
|
|
83149
|
+
if (resolvedValueSymbol && resolvedValueSymbol === resolvedTypeSymbol) {
|
|
83173
83150
|
const globalPromiseSymbol = getGlobalPromiseConstructorSymbol(
|
|
83174
83151
|
/*reportErrors*/
|
|
83175
83152
|
false
|
|
83176
83153
|
);
|
|
83177
|
-
if (globalPromiseSymbol &&
|
|
83154
|
+
if (globalPromiseSymbol && resolvedValueSymbol === globalPromiseSymbol) {
|
|
83178
83155
|
return 9 /* Promise */;
|
|
83179
83156
|
}
|
|
83180
|
-
const constructorType = getTypeOfSymbol(
|
|
83157
|
+
const constructorType = getTypeOfSymbol(resolvedValueSymbol);
|
|
83181
83158
|
if (constructorType && isConstructorType(constructorType)) {
|
|
83182
83159
|
return isTypeOnly ? 10 /* TypeWithCallSignature */ : 1 /* TypeWithConstructSignatureAndValue */;
|
|
83183
83160
|
}
|
|
83184
83161
|
}
|
|
83185
|
-
if (!
|
|
83162
|
+
if (!resolvedTypeSymbol) {
|
|
83186
83163
|
return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */;
|
|
83187
83164
|
}
|
|
83188
|
-
const type = getDeclaredTypeOfSymbol(
|
|
83165
|
+
const type = getDeclaredTypeOfSymbol(resolvedTypeSymbol);
|
|
83189
83166
|
if (isErrorType(type)) {
|
|
83190
83167
|
return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */;
|
|
83191
83168
|
} else if (type.flags & 3 /* AnyOrUnknown */) {
|
|
@@ -85317,7 +85294,7 @@ function createTypeChecker(host) {
|
|
|
85317
85294
|
}
|
|
85318
85295
|
}
|
|
85319
85296
|
function findBestTypeForObjectLiteral(source, unionTarget) {
|
|
85320
|
-
if (getObjectFlags(source) &
|
|
85297
|
+
if (getObjectFlags(source) & 256 /* ObjectLiteral */ && someType(unionTarget, isArrayLikeType)) {
|
|
85321
85298
|
return find(unionTarget.types, (t) => !isArrayLikeType(t));
|
|
85322
85299
|
}
|
|
85323
85300
|
}
|
|
@@ -86843,13 +86820,13 @@ var visitEachChildTable = {
|
|
|
86843
86820
|
);
|
|
86844
86821
|
},
|
|
86845
86822
|
// Transformation nodes
|
|
86846
|
-
[
|
|
86823
|
+
[360 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
86847
86824
|
return context.factory.updatePartiallyEmittedExpression(
|
|
86848
86825
|
node,
|
|
86849
86826
|
Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
|
|
86850
86827
|
);
|
|
86851
86828
|
},
|
|
86852
|
-
[
|
|
86829
|
+
[361 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
86853
86830
|
return context.factory.updateCommaListExpression(
|
|
86854
86831
|
node,
|
|
86855
86832
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -88655,9 +88632,50 @@ function transformTypeScript(context) {
|
|
|
88655
88632
|
return visitorWorker(node);
|
|
88656
88633
|
}
|
|
88657
88634
|
}
|
|
88658
|
-
function
|
|
88635
|
+
function isElisionBlocked(node) {
|
|
88659
88636
|
const parsed = getParseTreeNode(node);
|
|
88660
|
-
if (parsed
|
|
88637
|
+
if (parsed === node || isExportAssignment(node)) {
|
|
88638
|
+
return false;
|
|
88639
|
+
}
|
|
88640
|
+
if (!parsed || parsed.kind !== node.kind) {
|
|
88641
|
+
return true;
|
|
88642
|
+
}
|
|
88643
|
+
switch (node.kind) {
|
|
88644
|
+
case 272 /* ImportDeclaration */:
|
|
88645
|
+
Debug.assertNode(parsed, isImportDeclaration);
|
|
88646
|
+
if (node.importClause !== parsed.importClause) {
|
|
88647
|
+
return true;
|
|
88648
|
+
}
|
|
88649
|
+
if (node.attributes !== parsed.attributes) {
|
|
88650
|
+
return true;
|
|
88651
|
+
}
|
|
88652
|
+
break;
|
|
88653
|
+
case 271 /* ImportEqualsDeclaration */:
|
|
88654
|
+
Debug.assertNode(parsed, isImportEqualsDeclaration);
|
|
88655
|
+
if (node.name !== parsed.name) {
|
|
88656
|
+
return true;
|
|
88657
|
+
}
|
|
88658
|
+
if (node.isTypeOnly !== parsed.isTypeOnly) {
|
|
88659
|
+
return true;
|
|
88660
|
+
}
|
|
88661
|
+
if (node.moduleReference !== parsed.moduleReference && (isEntityName(node.moduleReference) || isEntityName(parsed.moduleReference))) {
|
|
88662
|
+
return true;
|
|
88663
|
+
}
|
|
88664
|
+
break;
|
|
88665
|
+
case 278 /* ExportDeclaration */:
|
|
88666
|
+
Debug.assertNode(parsed, isExportDeclaration);
|
|
88667
|
+
if (node.exportClause !== parsed.exportClause) {
|
|
88668
|
+
return true;
|
|
88669
|
+
}
|
|
88670
|
+
if (node.attributes !== parsed.attributes) {
|
|
88671
|
+
return true;
|
|
88672
|
+
}
|
|
88673
|
+
break;
|
|
88674
|
+
}
|
|
88675
|
+
return false;
|
|
88676
|
+
}
|
|
88677
|
+
function visitElidableStatement(node) {
|
|
88678
|
+
if (isElisionBlocked(node)) {
|
|
88661
88679
|
if (node.transformFlags & 1 /* ContainsTypeScript */) {
|
|
88662
88680
|
return visitEachChild(node, visitor, context);
|
|
88663
88681
|
}
|
|
@@ -90502,7 +90520,7 @@ function transformClassFields(context) {
|
|
|
90502
90520
|
/*discarded*/
|
|
90503
90521
|
true
|
|
90504
90522
|
);
|
|
90505
|
-
case
|
|
90523
|
+
case 361 /* CommaListExpression */:
|
|
90506
90524
|
return visitCommaListExpression(
|
|
90507
90525
|
node,
|
|
90508
90526
|
/*discarded*/
|
|
@@ -93595,7 +93613,7 @@ function transformESDecorators(context) {
|
|
|
93595
93613
|
return visitForStatement(node);
|
|
93596
93614
|
case 244 /* ExpressionStatement */:
|
|
93597
93615
|
return visitExpressionStatement(node);
|
|
93598
|
-
case
|
|
93616
|
+
case 361 /* CommaListExpression */:
|
|
93599
93617
|
return visitCommaListExpression(
|
|
93600
93618
|
node,
|
|
93601
93619
|
/*discarded*/
|
|
@@ -93607,7 +93625,7 @@ function transformESDecorators(context) {
|
|
|
93607
93625
|
/*discarded*/
|
|
93608
93626
|
false
|
|
93609
93627
|
);
|
|
93610
|
-
case
|
|
93628
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
93611
93629
|
return visitPartiallyEmittedExpression(
|
|
93612
93630
|
node,
|
|
93613
93631
|
/*discarded*/
|
|
@@ -93693,7 +93711,7 @@ function transformESDecorators(context) {
|
|
|
93693
93711
|
/*discarded*/
|
|
93694
93712
|
true
|
|
93695
93713
|
);
|
|
93696
|
-
case
|
|
93714
|
+
case 361 /* CommaListExpression */:
|
|
93697
93715
|
return visitCommaListExpression(
|
|
93698
93716
|
node,
|
|
93699
93717
|
/*discarded*/
|
|
@@ -96284,7 +96302,7 @@ function transformES2018(context) {
|
|
|
96284
96302
|
return visitObjectLiteralExpression(node);
|
|
96285
96303
|
case 226 /* BinaryExpression */:
|
|
96286
96304
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
96287
|
-
case
|
|
96305
|
+
case 361 /* CommaListExpression */:
|
|
96288
96306
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
96289
96307
|
case 299 /* CatchClause */:
|
|
96290
96308
|
return visitCatchClause(node);
|
|
@@ -99507,7 +99525,7 @@ function transformES2015(context) {
|
|
|
99507
99525
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
99508
99526
|
case 226 /* BinaryExpression */:
|
|
99509
99527
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
99510
|
-
case
|
|
99528
|
+
case 361 /* CommaListExpression */:
|
|
99511
99529
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
99512
99530
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
99513
99531
|
case 16 /* TemplateHead */:
|
|
@@ -102873,7 +102891,7 @@ function transformGenerators(context) {
|
|
|
102873
102891
|
switch (node.kind) {
|
|
102874
102892
|
case 226 /* BinaryExpression */:
|
|
102875
102893
|
return visitBinaryExpression(node);
|
|
102876
|
-
case
|
|
102894
|
+
case 361 /* CommaListExpression */:
|
|
102877
102895
|
return visitCommaListExpression(node);
|
|
102878
102896
|
case 227 /* ConditionalExpression */:
|
|
102879
102897
|
return visitConditionalExpression(node);
|
|
@@ -105253,7 +105271,7 @@ function transformModule(context) {
|
|
|
105253
105271
|
return visitExpressionStatement(node);
|
|
105254
105272
|
case 217 /* ParenthesizedExpression */:
|
|
105255
105273
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
105256
|
-
case
|
|
105274
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
105257
105275
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
105258
105276
|
case 213 /* CallExpression */:
|
|
105259
105277
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -107657,7 +107675,7 @@ function transformSystemModule(context) {
|
|
|
107657
107675
|
return visitExpressionStatement(node);
|
|
107658
107676
|
case 217 /* ParenthesizedExpression */:
|
|
107659
107677
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
107660
|
-
case
|
|
107678
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
107661
107679
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
107662
107680
|
case 226 /* BinaryExpression */:
|
|
107663
107681
|
if (isDestructuringAssignment(node)) {
|
|
@@ -109773,8 +109791,6 @@ function transformDeclarations(context) {
|
|
|
109773
109791
|
}
|
|
109774
109792
|
if (isDeclaration(input) && isDeclarationAndNotVisible(input))
|
|
109775
109793
|
return;
|
|
109776
|
-
if (isJSDocImportTypeTag(input))
|
|
109777
|
-
return;
|
|
109778
109794
|
if (isFunctionLike(input) && resolver.isImplementationOfOverload(input))
|
|
109779
109795
|
return;
|
|
109780
109796
|
let previousEnclosingDeclaration;
|
|
@@ -110425,7 +110441,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
110425
110441
|
}
|
|
110426
110442
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
110427
110443
|
var _a, _b;
|
|
110428
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
110444
|
+
const enabledSyntaxKindFeatures = new Array(363 /* Count */);
|
|
110429
110445
|
let lexicalEnvironmentVariableDeclarations;
|
|
110430
110446
|
let lexicalEnvironmentFunctionDeclarations;
|
|
110431
110447
|
let lexicalEnvironmentStatements;
|
|
@@ -112316,9 +112332,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112316
112332
|
return emitJSDocTypedefTag(node);
|
|
112317
112333
|
case 354 /* JSDocSeeTag */:
|
|
112318
112334
|
return emitJSDocSeeTag(node);
|
|
112319
|
-
case
|
|
112320
|
-
return emitJSDocImportTypeTag(node);
|
|
112321
|
-
case 360 /* NotEmittedStatement */:
|
|
112335
|
+
case 359 /* NotEmittedStatement */:
|
|
112322
112336
|
return;
|
|
112323
112337
|
}
|
|
112324
112338
|
if (isExpression(node)) {
|
|
@@ -112419,15 +112433,15 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112419
112433
|
return emitJsxSelfClosingElement(node);
|
|
112420
112434
|
case 288 /* JsxFragment */:
|
|
112421
112435
|
return emitJsxFragment(node);
|
|
112422
|
-
case
|
|
112436
|
+
case 358 /* SyntaxList */:
|
|
112423
112437
|
return Debug.fail("SyntaxList should not be printed");
|
|
112424
|
-
case
|
|
112438
|
+
case 359 /* NotEmittedStatement */:
|
|
112425
112439
|
return;
|
|
112426
|
-
case
|
|
112440
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
112427
112441
|
return emitPartiallyEmittedExpression(node);
|
|
112428
|
-
case
|
|
112442
|
+
case 361 /* CommaListExpression */:
|
|
112429
112443
|
return emitCommaList(node);
|
|
112430
|
-
case
|
|
112444
|
+
case 362 /* SyntheticReferenceExpression */:
|
|
112431
112445
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
112432
112446
|
}
|
|
112433
112447
|
}
|
|
@@ -114325,16 +114339,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
114325
114339
|
emit(tag.name);
|
|
114326
114340
|
emitJSDocComment(tag.comment);
|
|
114327
114341
|
}
|
|
114328
|
-
function emitJSDocImportTypeTag(tag) {
|
|
114329
|
-
emitJSDocTagName(tag.tagName);
|
|
114330
|
-
writeSpace();
|
|
114331
|
-
emit(tag.importClause);
|
|
114332
|
-
writeSpace();
|
|
114333
|
-
emitTokenWithComment(161 /* FromKeyword */, tag.importClause.end, writeKeyword, tag);
|
|
114334
|
-
writeSpace();
|
|
114335
|
-
emitExpression(tag.moduleSpecifier);
|
|
114336
|
-
emitJSDocComment(tag.comment);
|
|
114337
|
-
}
|
|
114338
114342
|
function emitJSDocNameReference(node) {
|
|
114339
114343
|
writeSpace();
|
|
114340
114344
|
writePunctuation("{");
|
|
@@ -115834,7 +115838,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115834
115838
|
emitLeadingComments(
|
|
115835
115839
|
pos,
|
|
115836
115840
|
/*isEmittedNode*/
|
|
115837
|
-
node.kind !==
|
|
115841
|
+
node.kind !== 359 /* NotEmittedStatement */
|
|
115838
115842
|
);
|
|
115839
115843
|
}
|
|
115840
115844
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
@@ -115858,7 +115862,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115858
115862
|
containerPos = savedContainerPos;
|
|
115859
115863
|
containerEnd = savedContainerEnd;
|
|
115860
115864
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
115861
|
-
if (!skipTrailingComments && node.kind !==
|
|
115865
|
+
if (!skipTrailingComments && node.kind !== 359 /* NotEmittedStatement */) {
|
|
115862
115866
|
emitTrailingComments(end);
|
|
115863
115867
|
}
|
|
115864
115868
|
}
|
|
@@ -116130,7 +116134,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
116130
116134
|
}
|
|
116131
116135
|
} else {
|
|
116132
116136
|
const source = sourceMapRange.source || sourceMapSource;
|
|
116133
|
-
if (node.kind !==
|
|
116137
|
+
if (node.kind !== 359 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
116134
116138
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
116135
116139
|
}
|
|
116136
116140
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -116145,7 +116149,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
116145
116149
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
116146
116150
|
sourceMapsDisabled = false;
|
|
116147
116151
|
}
|
|
116148
|
-
if (node.kind !==
|
|
116152
|
+
if (node.kind !== 359 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
116149
116153
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
116150
116154
|
}
|
|
116151
116155
|
}
|
|
@@ -119046,9 +119050,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119046
119050
|
if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) {
|
|
119047
119051
|
collectDynamicImportOrRequireCalls(file);
|
|
119048
119052
|
}
|
|
119049
|
-
if (isJavaScriptFile) {
|
|
119050
|
-
collectJsDocImportTypeReferences(file);
|
|
119051
|
-
}
|
|
119052
119053
|
file.imports = imports || emptyArray;
|
|
119053
119054
|
file.moduleAugmentations = moduleAugmentations || emptyArray;
|
|
119054
119055
|
file.ambientModuleNames = ambientModules || emptyArray;
|
|
@@ -119123,23 +119124,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119123
119124
|
}
|
|
119124
119125
|
}
|
|
119125
119126
|
}
|
|
119126
|
-
function collectJsDocImportTypeReferences(file2) {
|
|
119127
|
-
const r = /@importType/g;
|
|
119128
|
-
while (r.exec(file2.text) !== null) {
|
|
119129
|
-
const node = getNodeAtPosition(file2, r.lastIndex);
|
|
119130
|
-
if (isJSDocImportTypeTag(node)) {
|
|
119131
|
-
const moduleNameExpr = getExternalModuleName(node);
|
|
119132
|
-
if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text) {
|
|
119133
|
-
setParentRecursive(
|
|
119134
|
-
node,
|
|
119135
|
-
/*incremental*/
|
|
119136
|
-
false
|
|
119137
|
-
);
|
|
119138
|
-
imports = append(imports, moduleNameExpr);
|
|
119139
|
-
}
|
|
119140
|
-
}
|
|
119141
|
-
}
|
|
119142
|
-
}
|
|
119143
119127
|
function getNodeAtPosition(sourceFile, position) {
|
|
119144
119128
|
let current = sourceFile;
|
|
119145
119129
|
const getContainingChild = (child) => {
|