@typescript-deploys/pr-build 5.4.0-pr-55924-19 → 5.4.0-pr-56458-11
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 +66 -69
- package/lib/tsserver.js +82 -54
- package/lib/typescript.js +82 -54
- package/lib/typingsInstaller.js +6 -21
- 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.20231120`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -972,23 +972,6 @@ function compareStringsCaseSensitive(a, b) {
|
|
|
972
972
|
function getStringComparer(ignoreCase) {
|
|
973
973
|
return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive;
|
|
974
974
|
}
|
|
975
|
-
var createUIStringComparer = (() => {
|
|
976
|
-
return createIntlCollatorStringComparer;
|
|
977
|
-
function compareWithCallback(a, b, comparer) {
|
|
978
|
-
if (a === b)
|
|
979
|
-
return 0 /* EqualTo */;
|
|
980
|
-
if (a === void 0)
|
|
981
|
-
return -1 /* LessThan */;
|
|
982
|
-
if (b === void 0)
|
|
983
|
-
return 1 /* GreaterThan */;
|
|
984
|
-
const value = comparer(a, b);
|
|
985
|
-
return value < 0 ? -1 /* LessThan */ : value > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;
|
|
986
|
-
}
|
|
987
|
-
function createIntlCollatorStringComparer(locale) {
|
|
988
|
-
const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare;
|
|
989
|
-
return (a, b) => compareWithCallback(a, b, comparer);
|
|
990
|
-
}
|
|
991
|
-
})();
|
|
992
975
|
var uiComparerCaseSensitive;
|
|
993
976
|
var uiLocale;
|
|
994
977
|
function setUILocale(value) {
|
|
@@ -3678,7 +3661,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3678
3661
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
3679
3662
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
3680
3663
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
3681
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
3664
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
3682
3665
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
3683
3666
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
3684
3667
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -5952,6 +5935,10 @@ var Diagnostics = {
|
|
|
5952
5935
|
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
5953
5936
|
A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
5954
5937
|
An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
|
|
5938
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
5939
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
5940
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
5941
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
5955
5942
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
5956
5943
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
5957
5944
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -6791,8 +6778,6 @@ var Diagnostics = {
|
|
|
6791
6778
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
6792
6779
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
6793
6780
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6794
|
-
Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
|
|
6795
|
-
Values_of_0_1_are_not_sufficiently_known: diag(4126, 1 /* Error */, "Values_of_0_1_are_not_sufficiently_known_4126", "Values of '{0}.{1}' are not sufficiently known."),
|
|
6796
6781
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
6797
6782
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
6798
6783
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -15989,7 +15974,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
|
|
|
15989
15974
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
15990
15975
|
}
|
|
15991
15976
|
function getObjectFlags(type) {
|
|
15992
|
-
return type.flags &
|
|
15977
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
15993
15978
|
}
|
|
15994
15979
|
function isUMDExportSymbol(symbol) {
|
|
15995
15980
|
return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
|
|
@@ -57002,7 +56987,7 @@ function createTypeChecker(host) {
|
|
|
57002
56987
|
}
|
|
57003
56988
|
}
|
|
57004
56989
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
57005
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
56990
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
57006
56991
|
if (templates.length) {
|
|
57007
56992
|
let i = types.length;
|
|
57008
56993
|
while (i > 0) {
|
|
@@ -57402,19 +57387,14 @@ function createTypeChecker(host) {
|
|
|
57402
57387
|
function getConstituentCountOfTypes(types) {
|
|
57403
57388
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
57404
57389
|
}
|
|
57405
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
57406
|
-
if (types.length !== 2) {
|
|
57407
|
-
return false;
|
|
57408
|
-
}
|
|
57409
|
-
const [t1, t2] = types;
|
|
57410
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
57411
|
-
}
|
|
57412
57390
|
function getTypeFromIntersectionTypeNode(node) {
|
|
57413
57391
|
const links = getNodeLinks(node);
|
|
57414
57392
|
if (!links.resolvedType) {
|
|
57415
57393
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
57416
57394
|
const types = map(node.types, getTypeFromTypeNode);
|
|
57417
|
-
const
|
|
57395
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
57396
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
57397
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
57418
57398
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
57419
57399
|
}
|
|
57420
57400
|
return links.resolvedType;
|
|
@@ -57601,7 +57581,7 @@ function createTypeChecker(host) {
|
|
|
57601
57581
|
return type;
|
|
57602
57582
|
function addSpans(texts2, types2) {
|
|
57603
57583
|
for (let i = 0; i < types2.length; i++) {
|
|
57604
|
-
const t = types2[i];
|
|
57584
|
+
const t = stripObjectTypeTags(types2[i]);
|
|
57605
57585
|
if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {
|
|
57606
57586
|
text += getTemplateStringForType(t) || "";
|
|
57607
57587
|
text += texts2[i + 1];
|
|
@@ -57621,16 +57601,20 @@ function createTypeChecker(host) {
|
|
|
57621
57601
|
return true;
|
|
57622
57602
|
}
|
|
57623
57603
|
}
|
|
57604
|
+
function stripObjectTypeTags(type) {
|
|
57605
|
+
if (type.flags & 2097152 /* Intersection */) {
|
|
57606
|
+
const nonObjectTypes = filter(type.types, (t) => !(t.flags & 524288 /* Object */));
|
|
57607
|
+
if (nonObjectTypes !== type.types) {
|
|
57608
|
+
return getIntersectionType(nonObjectTypes);
|
|
57609
|
+
}
|
|
57610
|
+
}
|
|
57611
|
+
return type;
|
|
57612
|
+
}
|
|
57624
57613
|
function getTemplateStringForType(type) {
|
|
57625
57614
|
return type.flags & 128 /* StringLiteral */ ? type.value : type.flags & 256 /* NumberLiteral */ ? "" + type.value : type.flags & 2048 /* BigIntLiteral */ ? pseudoBigIntToString(type.value) : type.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) ? type.intrinsicName : void 0;
|
|
57626
57615
|
}
|
|
57627
57616
|
function createTemplateLiteralType(texts, types) {
|
|
57628
57617
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
57629
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
57630
|
-
types,
|
|
57631
|
-
/*excludeKinds*/
|
|
57632
|
-
98304 /* Nullable */
|
|
57633
|
-
);
|
|
57634
57618
|
type.texts = texts;
|
|
57635
57619
|
type.types = types;
|
|
57636
57620
|
return type;
|
|
@@ -57924,10 +57908,7 @@ function createTypeChecker(host) {
|
|
|
57924
57908
|
return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
|
|
57925
57909
|
}
|
|
57926
57910
|
function isPatternLiteralPlaceholderType(type) {
|
|
57927
|
-
|
|
57928
|
-
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
|
|
57929
|
-
}
|
|
57930
|
-
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
57911
|
+
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || isPatternLiteralType(type) || type.flags & 2097152 /* Intersection */ && every(type.types, isPatternLiteralType));
|
|
57931
57912
|
}
|
|
57932
57913
|
function isPatternLiteralType(type) {
|
|
57933
57914
|
return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type);
|
|
@@ -57942,7 +57923,7 @@ function createTypeChecker(host) {
|
|
|
57942
57923
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
57943
57924
|
}
|
|
57944
57925
|
function getGenericObjectFlags(type) {
|
|
57945
|
-
if (type.flags &
|
|
57926
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
57946
57927
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
57947
57928
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
57948
57929
|
}
|
|
@@ -57954,7 +57935,7 @@ function createTypeChecker(host) {
|
|
|
57954
57935
|
}
|
|
57955
57936
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
57956
57937
|
}
|
|
57957
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
57938
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
57958
57939
|
}
|
|
57959
57940
|
function getSimplifiedType(type, writing) {
|
|
57960
57941
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -58980,7 +58961,7 @@ function createTypeChecker(host) {
|
|
|
58980
58961
|
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);
|
|
58981
58962
|
target.instantiations.set(id, result);
|
|
58982
58963
|
const resultObjectFlags = getObjectFlags(result);
|
|
58983
|
-
if (result.flags &
|
|
58964
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58984
58965
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
58985
58966
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58986
58967
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -60157,12 +60138,12 @@ function createTypeChecker(host) {
|
|
|
60157
60138
|
return !!(entry & 1 /* Succeeded */);
|
|
60158
60139
|
}
|
|
60159
60140
|
const targetEnumType = getTypeOfSymbol(targetSymbol);
|
|
60160
|
-
for (const
|
|
60161
|
-
if (
|
|
60162
|
-
const targetProperty = getPropertyOfType(targetEnumType,
|
|
60141
|
+
for (const property of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
|
|
60142
|
+
if (property.flags & 8 /* EnumMember */) {
|
|
60143
|
+
const targetProperty = getPropertyOfType(targetEnumType, property.escapedName);
|
|
60163
60144
|
if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) {
|
|
60164
60145
|
if (errorReporter) {
|
|
60165
|
-
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(
|
|
60146
|
+
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property), typeToString(
|
|
60166
60147
|
getDeclaredTypeOfSymbol(targetSymbol),
|
|
60167
60148
|
/*enclosingDeclaration*/
|
|
60168
60149
|
void 0,
|
|
@@ -60174,22 +60155,6 @@ function createTypeChecker(host) {
|
|
|
60174
60155
|
}
|
|
60175
60156
|
return false;
|
|
60176
60157
|
}
|
|
60177
|
-
const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 306 /* EnumMember */));
|
|
60178
|
-
const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 306 /* EnumMember */));
|
|
60179
|
-
if (sourceValue !== targetValue || sourceValue === void 0 || targetValue === void 0) {
|
|
60180
|
-
if (!errorReporter) {
|
|
60181
|
-
enumRelation.set(id, 2 /* Failed */);
|
|
60182
|
-
} else if (sourceValue !== targetValue && sourceValue !== void 0 && targetValue !== void 0) {
|
|
60183
|
-
const escapedSource = typeof sourceValue === "string" ? `"${escapeString(sourceValue)}"` : sourceValue;
|
|
60184
|
-
const escapedTarget = typeof targetValue === "string" ? `"${escapeString(targetValue)}"` : targetValue;
|
|
60185
|
-
errorReporter(Diagnostics.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, symbolName(targetSymbol), symbolName(targetProperty), escapedTarget, escapedSource);
|
|
60186
|
-
enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
|
|
60187
|
-
} else {
|
|
60188
|
-
errorReporter(Diagnostics.Values_of_0_1_are_not_sufficiently_known, symbolName(targetSymbol), symbolName(targetProperty));
|
|
60189
|
-
enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
|
|
60190
|
-
}
|
|
60191
|
-
return false;
|
|
60192
|
-
}
|
|
60193
60158
|
}
|
|
60194
60159
|
}
|
|
60195
60160
|
enumRelation.set(id, 1 /* Succeeded */);
|
|
@@ -63712,8 +63677,8 @@ function createTypeChecker(host) {
|
|
|
63712
63677
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
63713
63678
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
63714
63679
|
}
|
|
63715
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
63716
|
-
if (type.flags &
|
|
63680
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
63681
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
63717
63682
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
63718
63683
|
}
|
|
63719
63684
|
return result;
|
|
@@ -80686,10 +80651,11 @@ function createTypeChecker(host) {
|
|
|
80686
80651
|
node
|
|
80687
80652
|
));
|
|
80688
80653
|
if (sym) {
|
|
80654
|
+
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(sym, 111551 /* Value */);
|
|
80689
80655
|
markAliasReferenced(sym, id);
|
|
80690
80656
|
if (getSymbolFlags(sym) & 111551 /* Value */) {
|
|
80691
80657
|
checkExpressionCached(id);
|
|
80692
|
-
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax &&
|
|
80658
|
+
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && typeOnlyDeclaration) {
|
|
80693
80659
|
error(
|
|
80694
80660
|
id,
|
|
80695
80661
|
node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,
|
|
@@ -80703,6 +80669,33 @@ function createTypeChecker(host) {
|
|
|
80703
80669
|
idText(id)
|
|
80704
80670
|
);
|
|
80705
80671
|
}
|
|
80672
|
+
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
|
|
80673
|
+
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
|
|
80674
|
+
sym,
|
|
80675
|
+
/*excludeTypeOnlyMeanings*/
|
|
80676
|
+
false,
|
|
80677
|
+
/*excludeLocalMeanings*/
|
|
80678
|
+
true
|
|
80679
|
+
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
|
|
80680
|
+
error(
|
|
80681
|
+
id,
|
|
80682
|
+
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
|
80683
|
+
idText(id),
|
|
80684
|
+
isolatedModulesLikeFlagName
|
|
80685
|
+
);
|
|
80686
|
+
} else if (typeOnlyDeclaration && getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node)) {
|
|
80687
|
+
addTypeOnlyDeclarationRelatedInfo(
|
|
80688
|
+
error(
|
|
80689
|
+
id,
|
|
80690
|
+
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
|
80691
|
+
idText(id),
|
|
80692
|
+
isolatedModulesLikeFlagName
|
|
80693
|
+
),
|
|
80694
|
+
typeOnlyDeclaration,
|
|
80695
|
+
idText(id)
|
|
80696
|
+
);
|
|
80697
|
+
}
|
|
80698
|
+
}
|
|
80706
80699
|
} else {
|
|
80707
80700
|
checkExpressionCached(id);
|
|
80708
80701
|
}
|
|
@@ -82097,7 +82090,11 @@ function createTypeChecker(host) {
|
|
|
82097
82090
|
const exportClause = node.exportClause;
|
|
82098
82091
|
return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
|
|
82099
82092
|
case 277 /* ExportAssignment */:
|
|
82100
|
-
return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(
|
|
82093
|
+
return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(
|
|
82094
|
+
getSymbolOfDeclaration(node),
|
|
82095
|
+
/*excludeTypeOnlyValues*/
|
|
82096
|
+
true
|
|
82097
|
+
) : true;
|
|
82101
82098
|
}
|
|
82102
82099
|
return false;
|
|
82103
82100
|
}
|
|
@@ -82115,7 +82112,7 @@ function createTypeChecker(host) {
|
|
|
82115
82112
|
}
|
|
82116
82113
|
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
|
|
82117
82114
|
if (target === unknownSymbol) {
|
|
82118
|
-
return
|
|
82115
|
+
return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol);
|
|
82119
82116
|
}
|
|
82120
82117
|
return !!(getSymbolFlags(
|
|
82121
82118
|
symbol,
|
package/lib/tsserver.js
CHANGED
|
@@ -2330,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2330
2330
|
|
|
2331
2331
|
// src/compiler/corePublic.ts
|
|
2332
2332
|
var versionMajorMinor = "5.4";
|
|
2333
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2333
|
+
var version = `${versionMajorMinor}.0-insiders.20231120`;
|
|
2334
2334
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2335
2335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2336
2336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3624,7 +3624,7 @@ function compareStringsCaseSensitive(a, b) {
|
|
|
3624
3624
|
function getStringComparer(ignoreCase) {
|
|
3625
3625
|
return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive;
|
|
3626
3626
|
}
|
|
3627
|
-
var createUIStringComparer = (() => {
|
|
3627
|
+
var createUIStringComparer = /* @__PURE__ */ (() => {
|
|
3628
3628
|
return createIntlCollatorStringComparer;
|
|
3629
3629
|
function compareWithCallback(a, b, comparer) {
|
|
3630
3630
|
if (a === b)
|
|
@@ -6674,7 +6674,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
6674
6674
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
6675
6675
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
6676
6676
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
6677
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
6677
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
6678
6678
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
6679
6679
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
6680
6680
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -9484,6 +9484,10 @@ var Diagnostics = {
|
|
|
9484
9484
|
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
9485
9485
|
A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
9486
9486
|
An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
|
|
9487
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
9488
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
9489
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
9490
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
9487
9491
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
9488
9492
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
9489
9493
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -10323,8 +10327,6 @@ var Diagnostics = {
|
|
|
10323
10327
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
10324
10328
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
10325
10329
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
10326
|
-
Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
|
|
10327
|
-
Values_of_0_1_are_not_sufficiently_known: diag(4126, 1 /* Error */, "Values_of_0_1_are_not_sufficiently_known_4126", "Values of '{0}.{1}' are not sufficiently known."),
|
|
10328
10330
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
10329
10331
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
10330
10332
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -20058,7 +20060,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
|
|
|
20058
20060
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
20059
20061
|
}
|
|
20060
20062
|
function getObjectFlags(type) {
|
|
20061
|
-
return type.flags &
|
|
20063
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
20062
20064
|
}
|
|
20063
20065
|
function forSomeAncestorDirectory(directory, callback) {
|
|
20064
20066
|
return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0);
|
|
@@ -61710,7 +61712,7 @@ function createTypeChecker(host) {
|
|
|
61710
61712
|
}
|
|
61711
61713
|
}
|
|
61712
61714
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
61713
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
61715
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
61714
61716
|
if (templates.length) {
|
|
61715
61717
|
let i = types.length;
|
|
61716
61718
|
while (i > 0) {
|
|
@@ -62110,19 +62112,14 @@ function createTypeChecker(host) {
|
|
|
62110
62112
|
function getConstituentCountOfTypes(types) {
|
|
62111
62113
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
62112
62114
|
}
|
|
62113
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
62114
|
-
if (types.length !== 2) {
|
|
62115
|
-
return false;
|
|
62116
|
-
}
|
|
62117
|
-
const [t1, t2] = types;
|
|
62118
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
62119
|
-
}
|
|
62120
62115
|
function getTypeFromIntersectionTypeNode(node) {
|
|
62121
62116
|
const links = getNodeLinks(node);
|
|
62122
62117
|
if (!links.resolvedType) {
|
|
62123
62118
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
62124
62119
|
const types = map(node.types, getTypeFromTypeNode);
|
|
62125
|
-
const
|
|
62120
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
62121
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
62122
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
62126
62123
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
62127
62124
|
}
|
|
62128
62125
|
return links.resolvedType;
|
|
@@ -62309,7 +62306,7 @@ function createTypeChecker(host) {
|
|
|
62309
62306
|
return type;
|
|
62310
62307
|
function addSpans(texts2, types2) {
|
|
62311
62308
|
for (let i = 0; i < types2.length; i++) {
|
|
62312
|
-
const t = types2[i];
|
|
62309
|
+
const t = stripObjectTypeTags(types2[i]);
|
|
62313
62310
|
if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {
|
|
62314
62311
|
text += getTemplateStringForType(t) || "";
|
|
62315
62312
|
text += texts2[i + 1];
|
|
@@ -62329,16 +62326,20 @@ function createTypeChecker(host) {
|
|
|
62329
62326
|
return true;
|
|
62330
62327
|
}
|
|
62331
62328
|
}
|
|
62329
|
+
function stripObjectTypeTags(type) {
|
|
62330
|
+
if (type.flags & 2097152 /* Intersection */) {
|
|
62331
|
+
const nonObjectTypes = filter(type.types, (t) => !(t.flags & 524288 /* Object */));
|
|
62332
|
+
if (nonObjectTypes !== type.types) {
|
|
62333
|
+
return getIntersectionType(nonObjectTypes);
|
|
62334
|
+
}
|
|
62335
|
+
}
|
|
62336
|
+
return type;
|
|
62337
|
+
}
|
|
62332
62338
|
function getTemplateStringForType(type) {
|
|
62333
62339
|
return type.flags & 128 /* StringLiteral */ ? type.value : type.flags & 256 /* NumberLiteral */ ? "" + type.value : type.flags & 2048 /* BigIntLiteral */ ? pseudoBigIntToString(type.value) : type.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) ? type.intrinsicName : void 0;
|
|
62334
62340
|
}
|
|
62335
62341
|
function createTemplateLiteralType(texts, types) {
|
|
62336
62342
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
62337
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
62338
|
-
types,
|
|
62339
|
-
/*excludeKinds*/
|
|
62340
|
-
98304 /* Nullable */
|
|
62341
|
-
);
|
|
62342
62343
|
type.texts = texts;
|
|
62343
62344
|
type.types = types;
|
|
62344
62345
|
return type;
|
|
@@ -62632,10 +62633,7 @@ function createTypeChecker(host) {
|
|
|
62632
62633
|
return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
|
|
62633
62634
|
}
|
|
62634
62635
|
function isPatternLiteralPlaceholderType(type) {
|
|
62635
|
-
|
|
62636
|
-
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
|
|
62637
|
-
}
|
|
62638
|
-
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
62636
|
+
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || isPatternLiteralType(type) || type.flags & 2097152 /* Intersection */ && every(type.types, isPatternLiteralType));
|
|
62639
62637
|
}
|
|
62640
62638
|
function isPatternLiteralType(type) {
|
|
62641
62639
|
return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type);
|
|
@@ -62650,7 +62648,7 @@ function createTypeChecker(host) {
|
|
|
62650
62648
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
62651
62649
|
}
|
|
62652
62650
|
function getGenericObjectFlags(type) {
|
|
62653
|
-
if (type.flags &
|
|
62651
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
62654
62652
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
62655
62653
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
62656
62654
|
}
|
|
@@ -62662,7 +62660,7 @@ function createTypeChecker(host) {
|
|
|
62662
62660
|
}
|
|
62663
62661
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
62664
62662
|
}
|
|
62665
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
62663
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
62666
62664
|
}
|
|
62667
62665
|
function getSimplifiedType(type, writing) {
|
|
62668
62666
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -63688,7 +63686,7 @@ function createTypeChecker(host) {
|
|
|
63688
63686
|
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);
|
|
63689
63687
|
target.instantiations.set(id, result);
|
|
63690
63688
|
const resultObjectFlags = getObjectFlags(result);
|
|
63691
|
-
if (result.flags &
|
|
63689
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
63692
63690
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
63693
63691
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
63694
63692
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -64865,12 +64863,12 @@ function createTypeChecker(host) {
|
|
|
64865
64863
|
return !!(entry & 1 /* Succeeded */);
|
|
64866
64864
|
}
|
|
64867
64865
|
const targetEnumType = getTypeOfSymbol(targetSymbol);
|
|
64868
|
-
for (const
|
|
64869
|
-
if (
|
|
64870
|
-
const targetProperty = getPropertyOfType(targetEnumType,
|
|
64866
|
+
for (const property of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
|
|
64867
|
+
if (property.flags & 8 /* EnumMember */) {
|
|
64868
|
+
const targetProperty = getPropertyOfType(targetEnumType, property.escapedName);
|
|
64871
64869
|
if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) {
|
|
64872
64870
|
if (errorReporter) {
|
|
64873
|
-
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(
|
|
64871
|
+
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property), typeToString(
|
|
64874
64872
|
getDeclaredTypeOfSymbol(targetSymbol),
|
|
64875
64873
|
/*enclosingDeclaration*/
|
|
64876
64874
|
void 0,
|
|
@@ -64882,22 +64880,6 @@ function createTypeChecker(host) {
|
|
|
64882
64880
|
}
|
|
64883
64881
|
return false;
|
|
64884
64882
|
}
|
|
64885
|
-
const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 306 /* EnumMember */));
|
|
64886
|
-
const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 306 /* EnumMember */));
|
|
64887
|
-
if (sourceValue !== targetValue || sourceValue === void 0 || targetValue === void 0) {
|
|
64888
|
-
if (!errorReporter) {
|
|
64889
|
-
enumRelation.set(id, 2 /* Failed */);
|
|
64890
|
-
} else if (sourceValue !== targetValue && sourceValue !== void 0 && targetValue !== void 0) {
|
|
64891
|
-
const escapedSource = typeof sourceValue === "string" ? `"${escapeString(sourceValue)}"` : sourceValue;
|
|
64892
|
-
const escapedTarget = typeof targetValue === "string" ? `"${escapeString(targetValue)}"` : targetValue;
|
|
64893
|
-
errorReporter(Diagnostics.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, symbolName(targetSymbol), symbolName(targetProperty), escapedTarget, escapedSource);
|
|
64894
|
-
enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
|
|
64895
|
-
} else {
|
|
64896
|
-
errorReporter(Diagnostics.Values_of_0_1_are_not_sufficiently_known, symbolName(targetSymbol), symbolName(targetProperty));
|
|
64897
|
-
enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
|
|
64898
|
-
}
|
|
64899
|
-
return false;
|
|
64900
|
-
}
|
|
64901
64883
|
}
|
|
64902
64884
|
}
|
|
64903
64885
|
enumRelation.set(id, 1 /* Succeeded */);
|
|
@@ -68420,8 +68402,8 @@ function createTypeChecker(host) {
|
|
|
68420
68402
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
68421
68403
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
68422
68404
|
}
|
|
68423
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
68424
|
-
if (type.flags &
|
|
68405
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
68406
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
68425
68407
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
68426
68408
|
}
|
|
68427
68409
|
return result;
|
|
@@ -85394,10 +85376,11 @@ function createTypeChecker(host) {
|
|
|
85394
85376
|
node
|
|
85395
85377
|
));
|
|
85396
85378
|
if (sym) {
|
|
85379
|
+
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(sym, 111551 /* Value */);
|
|
85397
85380
|
markAliasReferenced(sym, id);
|
|
85398
85381
|
if (getSymbolFlags(sym) & 111551 /* Value */) {
|
|
85399
85382
|
checkExpressionCached(id);
|
|
85400
|
-
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax &&
|
|
85383
|
+
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && typeOnlyDeclaration) {
|
|
85401
85384
|
error2(
|
|
85402
85385
|
id,
|
|
85403
85386
|
node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,
|
|
@@ -85411,6 +85394,33 @@ function createTypeChecker(host) {
|
|
|
85411
85394
|
idText(id)
|
|
85412
85395
|
);
|
|
85413
85396
|
}
|
|
85397
|
+
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
|
|
85398
|
+
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
|
|
85399
|
+
sym,
|
|
85400
|
+
/*excludeTypeOnlyMeanings*/
|
|
85401
|
+
false,
|
|
85402
|
+
/*excludeLocalMeanings*/
|
|
85403
|
+
true
|
|
85404
|
+
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
|
|
85405
|
+
error2(
|
|
85406
|
+
id,
|
|
85407
|
+
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
|
85408
|
+
idText(id),
|
|
85409
|
+
isolatedModulesLikeFlagName
|
|
85410
|
+
);
|
|
85411
|
+
} else if (typeOnlyDeclaration && getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node)) {
|
|
85412
|
+
addTypeOnlyDeclarationRelatedInfo(
|
|
85413
|
+
error2(
|
|
85414
|
+
id,
|
|
85415
|
+
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
|
85416
|
+
idText(id),
|
|
85417
|
+
isolatedModulesLikeFlagName
|
|
85418
|
+
),
|
|
85419
|
+
typeOnlyDeclaration,
|
|
85420
|
+
idText(id)
|
|
85421
|
+
);
|
|
85422
|
+
}
|
|
85423
|
+
}
|
|
85414
85424
|
} else {
|
|
85415
85425
|
checkExpressionCached(id);
|
|
85416
85426
|
}
|
|
@@ -86805,7 +86815,11 @@ function createTypeChecker(host) {
|
|
|
86805
86815
|
const exportClause = node.exportClause;
|
|
86806
86816
|
return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
|
|
86807
86817
|
case 277 /* ExportAssignment */:
|
|
86808
|
-
return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(
|
|
86818
|
+
return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(
|
|
86819
|
+
getSymbolOfDeclaration(node),
|
|
86820
|
+
/*excludeTypeOnlyValues*/
|
|
86821
|
+
true
|
|
86822
|
+
) : true;
|
|
86809
86823
|
}
|
|
86810
86824
|
return false;
|
|
86811
86825
|
}
|
|
@@ -86823,7 +86837,7 @@ function createTypeChecker(host) {
|
|
|
86823
86837
|
}
|
|
86824
86838
|
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
|
|
86825
86839
|
if (target === unknownSymbol) {
|
|
86826
|
-
return
|
|
86840
|
+
return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol);
|
|
86827
86841
|
}
|
|
86828
86842
|
return !!(getSymbolFlags(
|
|
86829
86843
|
symbol,
|
|
@@ -133449,7 +133463,8 @@ function buildLinkParts(link, checker) {
|
|
|
133449
133463
|
if (text)
|
|
133450
133464
|
parts.push(linkTextPart(text));
|
|
133451
133465
|
} else {
|
|
133452
|
-
|
|
133466
|
+
const separator = suffix === 0 || link.text.charCodeAt(suffix) === 124 /* bar */ && name.charCodeAt(name.length - 1) !== 32 /* space */ ? " " : "";
|
|
133467
|
+
parts.push(linkTextPart(name + separator + text));
|
|
133453
133468
|
}
|
|
133454
133469
|
}
|
|
133455
133470
|
parts.push(linkPart("}"));
|
|
@@ -163920,6 +163935,10 @@ var Core;
|
|
|
163920
163935
|
getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent2, search, state, addReferencesHere);
|
|
163921
163936
|
return;
|
|
163922
163937
|
}
|
|
163938
|
+
if (isJSDocPropertyLikeTag(parent2) && parent2.isNameFirst && parent2.typeExpression && isJSDocTypeLiteral(parent2.typeExpression.type) && parent2.typeExpression.type.jsDocPropertyTags && length(parent2.typeExpression.type.jsDocPropertyTags)) {
|
|
163939
|
+
getReferencesAtJSDocTypeLiteral(parent2.typeExpression.type.jsDocPropertyTags, referenceLocation, search, state);
|
|
163940
|
+
return;
|
|
163941
|
+
}
|
|
163923
163942
|
const relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state);
|
|
163924
163943
|
if (!relatedSymbol) {
|
|
163925
163944
|
getReferenceForShorthandProperty(referenceSymbol, search, state);
|
|
@@ -163946,6 +163965,15 @@ var Core;
|
|
|
163946
163965
|
}
|
|
163947
163966
|
getImportOrExportReferences(referenceLocation, referenceSymbol, search, state);
|
|
163948
163967
|
}
|
|
163968
|
+
function getReferencesAtJSDocTypeLiteral(jsDocPropertyTags, referenceLocation, search, state) {
|
|
163969
|
+
const addRef = state.referenceAdder(search.symbol);
|
|
163970
|
+
addReference(referenceLocation, search.symbol, state);
|
|
163971
|
+
forEach(jsDocPropertyTags, (propTag) => {
|
|
163972
|
+
if (isQualifiedName(propTag.name)) {
|
|
163973
|
+
addRef(propTag.name.left);
|
|
163974
|
+
}
|
|
163975
|
+
});
|
|
163976
|
+
}
|
|
163949
163977
|
function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) {
|
|
163950
163978
|
Debug.assert(!alwaysGetReferences || !!state.options.providePrefixAndSuffixTextForRename, "If alwaysGetReferences is true, then prefix/suffix text must be enabled");
|
|
163951
163979
|
const { parent: parent2, propertyName, name } = exportSpecifier;
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20231120`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -1636,7 +1636,7 @@ var ts = (() => {
|
|
|
1636
1636
|
AssertionLevel2[AssertionLevel2["VeryAggressive"] = 3] = "VeryAggressive";
|
|
1637
1637
|
return AssertionLevel2;
|
|
1638
1638
|
})(AssertionLevel || {});
|
|
1639
|
-
createUIStringComparer = (() => {
|
|
1639
|
+
createUIStringComparer = /* @__PURE__ */ (() => {
|
|
1640
1640
|
return createIntlCollatorStringComparer;
|
|
1641
1641
|
function compareWithCallback(a, b, comparer) {
|
|
1642
1642
|
if (a === b)
|
|
@@ -4437,7 +4437,7 @@ ${lanes.join("\n")}
|
|
|
4437
4437
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
4438
4438
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
4439
4439
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
4440
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
4440
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
4441
4441
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
4442
4442
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
4443
4443
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -7264,6 +7264,10 @@ ${lanes.join("\n")}
|
|
|
7264
7264
|
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
7265
7265
|
A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
7266
7266
|
An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
|
|
7267
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
7268
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
7269
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
7270
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
7267
7271
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
7268
7272
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
7269
7273
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -8103,8 +8107,6 @@ ${lanes.join("\n")}
|
|
|
8103
8107
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
8104
8108
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
8105
8109
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
8106
|
-
Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
|
|
8107
|
-
Values_of_0_1_are_not_sufficiently_known: diag(4126, 1 /* Error */, "Values_of_0_1_are_not_sufficiently_known_4126", "Values of '{0}.{1}' are not sufficiently known."),
|
|
8108
8110
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
8109
8111
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
8110
8112
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -17357,7 +17359,7 @@ ${lanes.join("\n")}
|
|
|
17357
17359
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
17358
17360
|
}
|
|
17359
17361
|
function getObjectFlags(type) {
|
|
17360
|
-
return type.flags &
|
|
17362
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
17361
17363
|
}
|
|
17362
17364
|
function forSomeAncestorDirectory(directory, callback) {
|
|
17363
17365
|
return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0);
|
|
@@ -59475,7 +59477,7 @@ ${lanes.join("\n")}
|
|
|
59475
59477
|
}
|
|
59476
59478
|
}
|
|
59477
59479
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
59478
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
59480
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
59479
59481
|
if (templates.length) {
|
|
59480
59482
|
let i = types.length;
|
|
59481
59483
|
while (i > 0) {
|
|
@@ -59875,19 +59877,14 @@ ${lanes.join("\n")}
|
|
|
59875
59877
|
function getConstituentCountOfTypes(types) {
|
|
59876
59878
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
59877
59879
|
}
|
|
59878
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
59879
|
-
if (types.length !== 2) {
|
|
59880
|
-
return false;
|
|
59881
|
-
}
|
|
59882
|
-
const [t1, t2] = types;
|
|
59883
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
59884
|
-
}
|
|
59885
59880
|
function getTypeFromIntersectionTypeNode(node) {
|
|
59886
59881
|
const links = getNodeLinks(node);
|
|
59887
59882
|
if (!links.resolvedType) {
|
|
59888
59883
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
59889
59884
|
const types = map(node.types, getTypeFromTypeNode);
|
|
59890
|
-
const
|
|
59885
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
59886
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
59887
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
59891
59888
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
59892
59889
|
}
|
|
59893
59890
|
return links.resolvedType;
|
|
@@ -60074,7 +60071,7 @@ ${lanes.join("\n")}
|
|
|
60074
60071
|
return type;
|
|
60075
60072
|
function addSpans(texts2, types2) {
|
|
60076
60073
|
for (let i = 0; i < types2.length; i++) {
|
|
60077
|
-
const t = types2[i];
|
|
60074
|
+
const t = stripObjectTypeTags(types2[i]);
|
|
60078
60075
|
if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {
|
|
60079
60076
|
text += getTemplateStringForType(t) || "";
|
|
60080
60077
|
text += texts2[i + 1];
|
|
@@ -60094,16 +60091,20 @@ ${lanes.join("\n")}
|
|
|
60094
60091
|
return true;
|
|
60095
60092
|
}
|
|
60096
60093
|
}
|
|
60094
|
+
function stripObjectTypeTags(type) {
|
|
60095
|
+
if (type.flags & 2097152 /* Intersection */) {
|
|
60096
|
+
const nonObjectTypes = filter(type.types, (t) => !(t.flags & 524288 /* Object */));
|
|
60097
|
+
if (nonObjectTypes !== type.types) {
|
|
60098
|
+
return getIntersectionType(nonObjectTypes);
|
|
60099
|
+
}
|
|
60100
|
+
}
|
|
60101
|
+
return type;
|
|
60102
|
+
}
|
|
60097
60103
|
function getTemplateStringForType(type) {
|
|
60098
60104
|
return type.flags & 128 /* StringLiteral */ ? type.value : type.flags & 256 /* NumberLiteral */ ? "" + type.value : type.flags & 2048 /* BigIntLiteral */ ? pseudoBigIntToString(type.value) : type.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) ? type.intrinsicName : void 0;
|
|
60099
60105
|
}
|
|
60100
60106
|
function createTemplateLiteralType(texts, types) {
|
|
60101
60107
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
60102
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
60103
|
-
types,
|
|
60104
|
-
/*excludeKinds*/
|
|
60105
|
-
98304 /* Nullable */
|
|
60106
|
-
);
|
|
60107
60108
|
type.texts = texts;
|
|
60108
60109
|
type.types = types;
|
|
60109
60110
|
return type;
|
|
@@ -60397,10 +60398,7 @@ ${lanes.join("\n")}
|
|
|
60397
60398
|
return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
|
|
60398
60399
|
}
|
|
60399
60400
|
function isPatternLiteralPlaceholderType(type) {
|
|
60400
|
-
|
|
60401
|
-
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
|
|
60402
|
-
}
|
|
60403
|
-
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
60401
|
+
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || isPatternLiteralType(type) || type.flags & 2097152 /* Intersection */ && every(type.types, isPatternLiteralType));
|
|
60404
60402
|
}
|
|
60405
60403
|
function isPatternLiteralType(type) {
|
|
60406
60404
|
return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type);
|
|
@@ -60415,7 +60413,7 @@ ${lanes.join("\n")}
|
|
|
60415
60413
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
60416
60414
|
}
|
|
60417
60415
|
function getGenericObjectFlags(type) {
|
|
60418
|
-
if (type.flags &
|
|
60416
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
60419
60417
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
60420
60418
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
60421
60419
|
}
|
|
@@ -60427,7 +60425,7 @@ ${lanes.join("\n")}
|
|
|
60427
60425
|
}
|
|
60428
60426
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
60429
60427
|
}
|
|
60430
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
60428
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
60431
60429
|
}
|
|
60432
60430
|
function getSimplifiedType(type, writing) {
|
|
60433
60431
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -61453,7 +61451,7 @@ ${lanes.join("\n")}
|
|
|
61453
61451
|
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);
|
|
61454
61452
|
target.instantiations.set(id, result);
|
|
61455
61453
|
const resultObjectFlags = getObjectFlags(result);
|
|
61456
|
-
if (result.flags &
|
|
61454
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
61457
61455
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
61458
61456
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
61459
61457
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -62630,12 +62628,12 @@ ${lanes.join("\n")}
|
|
|
62630
62628
|
return !!(entry & 1 /* Succeeded */);
|
|
62631
62629
|
}
|
|
62632
62630
|
const targetEnumType = getTypeOfSymbol(targetSymbol);
|
|
62633
|
-
for (const
|
|
62634
|
-
if (
|
|
62635
|
-
const targetProperty = getPropertyOfType(targetEnumType,
|
|
62631
|
+
for (const property of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
|
|
62632
|
+
if (property.flags & 8 /* EnumMember */) {
|
|
62633
|
+
const targetProperty = getPropertyOfType(targetEnumType, property.escapedName);
|
|
62636
62634
|
if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) {
|
|
62637
62635
|
if (errorReporter) {
|
|
62638
|
-
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(
|
|
62636
|
+
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property), typeToString(
|
|
62639
62637
|
getDeclaredTypeOfSymbol(targetSymbol),
|
|
62640
62638
|
/*enclosingDeclaration*/
|
|
62641
62639
|
void 0,
|
|
@@ -62647,22 +62645,6 @@ ${lanes.join("\n")}
|
|
|
62647
62645
|
}
|
|
62648
62646
|
return false;
|
|
62649
62647
|
}
|
|
62650
|
-
const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 306 /* EnumMember */));
|
|
62651
|
-
const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 306 /* EnumMember */));
|
|
62652
|
-
if (sourceValue !== targetValue || sourceValue === void 0 || targetValue === void 0) {
|
|
62653
|
-
if (!errorReporter) {
|
|
62654
|
-
enumRelation.set(id, 2 /* Failed */);
|
|
62655
|
-
} else if (sourceValue !== targetValue && sourceValue !== void 0 && targetValue !== void 0) {
|
|
62656
|
-
const escapedSource = typeof sourceValue === "string" ? `"${escapeString(sourceValue)}"` : sourceValue;
|
|
62657
|
-
const escapedTarget = typeof targetValue === "string" ? `"${escapeString(targetValue)}"` : targetValue;
|
|
62658
|
-
errorReporter(Diagnostics.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, symbolName(targetSymbol), symbolName(targetProperty), escapedTarget, escapedSource);
|
|
62659
|
-
enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
|
|
62660
|
-
} else {
|
|
62661
|
-
errorReporter(Diagnostics.Values_of_0_1_are_not_sufficiently_known, symbolName(targetSymbol), symbolName(targetProperty));
|
|
62662
|
-
enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
|
|
62663
|
-
}
|
|
62664
|
-
return false;
|
|
62665
|
-
}
|
|
62666
62648
|
}
|
|
62667
62649
|
}
|
|
62668
62650
|
enumRelation.set(id, 1 /* Succeeded */);
|
|
@@ -66185,8 +66167,8 @@ ${lanes.join("\n")}
|
|
|
66185
66167
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
66186
66168
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
66187
66169
|
}
|
|
66188
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
66189
|
-
if (type.flags &
|
|
66170
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
66171
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
66190
66172
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
66191
66173
|
}
|
|
66192
66174
|
return result;
|
|
@@ -83159,10 +83141,11 @@ ${lanes.join("\n")}
|
|
|
83159
83141
|
node
|
|
83160
83142
|
));
|
|
83161
83143
|
if (sym) {
|
|
83144
|
+
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(sym, 111551 /* Value */);
|
|
83162
83145
|
markAliasReferenced(sym, id);
|
|
83163
83146
|
if (getSymbolFlags(sym) & 111551 /* Value */) {
|
|
83164
83147
|
checkExpressionCached(id);
|
|
83165
|
-
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax &&
|
|
83148
|
+
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && typeOnlyDeclaration) {
|
|
83166
83149
|
error2(
|
|
83167
83150
|
id,
|
|
83168
83151
|
node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,
|
|
@@ -83176,6 +83159,33 @@ ${lanes.join("\n")}
|
|
|
83176
83159
|
idText(id)
|
|
83177
83160
|
);
|
|
83178
83161
|
}
|
|
83162
|
+
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
|
|
83163
|
+
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
|
|
83164
|
+
sym,
|
|
83165
|
+
/*excludeTypeOnlyMeanings*/
|
|
83166
|
+
false,
|
|
83167
|
+
/*excludeLocalMeanings*/
|
|
83168
|
+
true
|
|
83169
|
+
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
|
|
83170
|
+
error2(
|
|
83171
|
+
id,
|
|
83172
|
+
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
|
83173
|
+
idText(id),
|
|
83174
|
+
isolatedModulesLikeFlagName
|
|
83175
|
+
);
|
|
83176
|
+
} else if (typeOnlyDeclaration && getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node)) {
|
|
83177
|
+
addTypeOnlyDeclarationRelatedInfo(
|
|
83178
|
+
error2(
|
|
83179
|
+
id,
|
|
83180
|
+
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
|
83181
|
+
idText(id),
|
|
83182
|
+
isolatedModulesLikeFlagName
|
|
83183
|
+
),
|
|
83184
|
+
typeOnlyDeclaration,
|
|
83185
|
+
idText(id)
|
|
83186
|
+
);
|
|
83187
|
+
}
|
|
83188
|
+
}
|
|
83179
83189
|
} else {
|
|
83180
83190
|
checkExpressionCached(id);
|
|
83181
83191
|
}
|
|
@@ -84570,7 +84580,11 @@ ${lanes.join("\n")}
|
|
|
84570
84580
|
const exportClause = node.exportClause;
|
|
84571
84581
|
return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
|
|
84572
84582
|
case 277 /* ExportAssignment */:
|
|
84573
|
-
return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(
|
|
84583
|
+
return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(
|
|
84584
|
+
getSymbolOfDeclaration(node),
|
|
84585
|
+
/*excludeTypeOnlyValues*/
|
|
84586
|
+
true
|
|
84587
|
+
) : true;
|
|
84574
84588
|
}
|
|
84575
84589
|
return false;
|
|
84576
84590
|
}
|
|
@@ -84588,7 +84602,7 @@ ${lanes.join("\n")}
|
|
|
84588
84602
|
}
|
|
84589
84603
|
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
|
|
84590
84604
|
if (target === unknownSymbol) {
|
|
84591
|
-
return
|
|
84605
|
+
return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol);
|
|
84592
84606
|
}
|
|
84593
84607
|
return !!(getSymbolFlags(
|
|
84594
84608
|
symbol,
|
|
@@ -131713,7 +131727,8 @@ ${lanes.join("\n")}
|
|
|
131713
131727
|
if (text)
|
|
131714
131728
|
parts.push(linkTextPart(text));
|
|
131715
131729
|
} else {
|
|
131716
|
-
|
|
131730
|
+
const separator = suffix === 0 || link.text.charCodeAt(suffix) === 124 /* bar */ && name.charCodeAt(name.length - 1) !== 32 /* space */ ? " " : "";
|
|
131731
|
+
parts.push(linkTextPart(name + separator + text));
|
|
131717
131732
|
}
|
|
131718
131733
|
}
|
|
131719
131734
|
parts.push(linkPart("}"));
|
|
@@ -163222,6 +163237,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163222
163237
|
getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent2, search, state, addReferencesHere);
|
|
163223
163238
|
return;
|
|
163224
163239
|
}
|
|
163240
|
+
if (isJSDocPropertyLikeTag(parent2) && parent2.isNameFirst && parent2.typeExpression && isJSDocTypeLiteral(parent2.typeExpression.type) && parent2.typeExpression.type.jsDocPropertyTags && length(parent2.typeExpression.type.jsDocPropertyTags)) {
|
|
163241
|
+
getReferencesAtJSDocTypeLiteral(parent2.typeExpression.type.jsDocPropertyTags, referenceLocation, search, state);
|
|
163242
|
+
return;
|
|
163243
|
+
}
|
|
163225
163244
|
const relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state);
|
|
163226
163245
|
if (!relatedSymbol) {
|
|
163227
163246
|
getReferenceForShorthandProperty(referenceSymbol, search, state);
|
|
@@ -163248,6 +163267,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163248
163267
|
}
|
|
163249
163268
|
getImportOrExportReferences(referenceLocation, referenceSymbol, search, state);
|
|
163250
163269
|
}
|
|
163270
|
+
function getReferencesAtJSDocTypeLiteral(jsDocPropertyTags, referenceLocation, search, state) {
|
|
163271
|
+
const addRef = state.referenceAdder(search.symbol);
|
|
163272
|
+
addReference(referenceLocation, search.symbol, state);
|
|
163273
|
+
forEach(jsDocPropertyTags, (propTag) => {
|
|
163274
|
+
if (isQualifiedName(propTag.name)) {
|
|
163275
|
+
addRef(propTag.name.left);
|
|
163276
|
+
}
|
|
163277
|
+
});
|
|
163278
|
+
}
|
|
163251
163279
|
function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) {
|
|
163252
163280
|
Debug.assert(!alwaysGetReferences || !!state.options.providePrefixAndSuffixTextForRename, "If alwaysGetReferences is true, then prefix/suffix text must be enabled");
|
|
163253
163281
|
const { parent: parent2, propertyName, name } = exportSpecifier;
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20231120`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -568,23 +568,6 @@ function compareStringsCaseSensitive(a, b) {
|
|
|
568
568
|
function getStringComparer(ignoreCase) {
|
|
569
569
|
return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive;
|
|
570
570
|
}
|
|
571
|
-
var createUIStringComparer = (() => {
|
|
572
|
-
return createIntlCollatorStringComparer;
|
|
573
|
-
function compareWithCallback(a, b, comparer) {
|
|
574
|
-
if (a === b)
|
|
575
|
-
return 0 /* EqualTo */;
|
|
576
|
-
if (a === void 0)
|
|
577
|
-
return -1 /* LessThan */;
|
|
578
|
-
if (b === void 0)
|
|
579
|
-
return 1 /* GreaterThan */;
|
|
580
|
-
const value = comparer(a, b);
|
|
581
|
-
return value < 0 ? -1 /* LessThan */ : value > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;
|
|
582
|
-
}
|
|
583
|
-
function createIntlCollatorStringComparer(locale) {
|
|
584
|
-
const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare;
|
|
585
|
-
return (a, b) => compareWithCallback(a, b, comparer);
|
|
586
|
-
}
|
|
587
|
-
})();
|
|
588
571
|
function getSpellingSuggestion(name, candidates, getName) {
|
|
589
572
|
const maximumLengthDifference = Math.max(2, Math.floor(name.length * 0.34));
|
|
590
573
|
let bestDistance = Math.floor(name.length * 0.4) + 1;
|
|
@@ -3112,7 +3095,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3112
3095
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
3113
3096
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
3114
3097
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
3115
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
3098
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
3116
3099
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
3117
3100
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
3118
3101
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -5329,6 +5312,10 @@ var Diagnostics = {
|
|
|
5329
5312
|
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
5330
5313
|
A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
5331
5314
|
An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
|
|
5315
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
5316
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
5317
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
5318
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
5332
5319
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
5333
5320
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
5334
5321
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -6168,8 +6155,6 @@ var Diagnostics = {
|
|
|
6168
6155
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
6169
6156
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
6170
6157
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6171
|
-
Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
|
|
6172
|
-
Values_of_0_1_are_not_sufficiently_known: diag(4126, 1 /* Error */, "Values_of_0_1_are_not_sufficiently_known_4126", "Values of '{0}.{1}' are not sufficiently known."),
|
|
6173
6158
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
6174
6159
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
6175
6160
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-56458-11",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"node": "20.1.0",
|
|
116
116
|
"npm": "8.19.4"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "77383fdc53afe5fd1984eeef6606dac7fd5428a4"
|
|
119
119
|
}
|