@typescript-deploys/pr-build 5.4.0-pr-55774-37 → 5.4.0-pr-56418-6
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 +23 -28
- package/lib/tsserver.js +23 -28
- package/lib/typescript.js +23 -28
- package/lib/typingsInstaller.js +2 -3
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -6682,6 +6682,7 @@ var Diagnostics = {
|
|
|
6682
6682
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
6683
6683
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
6684
6684
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
6685
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
6685
6686
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6686
6687
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
6687
6688
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -10976,7 +10977,7 @@ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
|
|
|
10976
10977
|
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 205 /* ImportType */;
|
|
10977
10978
|
}
|
|
10978
10979
|
function isCallLikeOrFunctionLikeExpression(node) {
|
|
10979
|
-
return isCallLikeExpression(node) ||
|
|
10980
|
+
return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node);
|
|
10980
10981
|
}
|
|
10981
10982
|
function isCallLikeExpression(node) {
|
|
10982
10983
|
switch (node.kind) {
|
|
@@ -18838,10 +18839,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18838
18839
|
return update(updated, original);
|
|
18839
18840
|
}
|
|
18840
18841
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
18841
|
-
const text = typeof value === "number" ? value + "" : value;
|
|
18842
|
-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
18843
18842
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
18844
|
-
node.text =
|
|
18843
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
18845
18844
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
18846
18845
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
18847
18846
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -43707,7 +43706,7 @@ function createTypeChecker(host) {
|
|
|
43707
43706
|
const nodeLinks2 = getNodeLinks(node);
|
|
43708
43707
|
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
|
|
43709
43708
|
nodeLinks2.resolvedSignature = void 0;
|
|
43710
|
-
if (
|
|
43709
|
+
if (isFunctionExpressionOrArrowFunction(node)) {
|
|
43711
43710
|
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
|
|
43712
43711
|
const type = symbolLinks2.type;
|
|
43713
43712
|
cachedTypes2.push([symbolLinks2, type]);
|
|
@@ -49535,7 +49534,7 @@ function createTypeChecker(host) {
|
|
|
49535
49534
|
return factory.createStringLiteral(name, !!singleQuote);
|
|
49536
49535
|
}
|
|
49537
49536
|
if (isNumericLiteralName(name) && startsWith(name, "-")) {
|
|
49538
|
-
return factory.createComputedPropertyName(factory.
|
|
49537
|
+
return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
|
|
49539
49538
|
}
|
|
49540
49539
|
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
|
|
49541
49540
|
}
|
|
@@ -54238,14 +54237,6 @@ function createTypeChecker(host) {
|
|
|
54238
54237
|
return getCheckFlags(s) & 4096 /* Late */;
|
|
54239
54238
|
}
|
|
54240
54239
|
function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
|
|
54241
|
-
if (isTupleType(type)) {
|
|
54242
|
-
forEachType(getUnionType(getElementTypes(type).map((_, i) => getStringLiteralType("" + i))), cb);
|
|
54243
|
-
return;
|
|
54244
|
-
}
|
|
54245
|
-
if (isArrayType(type)) {
|
|
54246
|
-
cb(numberType);
|
|
54247
|
-
return;
|
|
54248
|
-
}
|
|
54249
54240
|
for (const prop of getPropertiesOfType(type)) {
|
|
54250
54241
|
cb(getLiteralTypeFromProperty(prop, include));
|
|
54251
54242
|
}
|
|
@@ -56082,7 +56073,7 @@ function createTypeChecker(host) {
|
|
|
56082
56073
|
if (constraint) {
|
|
56083
56074
|
constraints = append(constraints, constraint);
|
|
56084
56075
|
}
|
|
56085
|
-
} else if (type.flags & 262144 /* TypeParameter */ && parent.kind === 200 /* MappedType */ &&
|
|
56076
|
+
} else if (type.flags & 262144 /* TypeParameter */ && parent.kind === 200 /* MappedType */ && node === parent.type) {
|
|
56086
56077
|
const mappedType = getTypeFromTypeNode(parent);
|
|
56087
56078
|
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
|
|
56088
56079
|
const typeParameter = getHomomorphicTypeVariable(mappedType);
|
|
@@ -75426,14 +75417,9 @@ function createTypeChecker(host) {
|
|
|
75426
75417
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
75427
75418
|
case 11 /* StringLiteral */:
|
|
75428
75419
|
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
75429
|
-
case 9 /* NumericLiteral */:
|
|
75420
|
+
case 9 /* NumericLiteral */:
|
|
75430
75421
|
checkGrammarNumericLiteral(node);
|
|
75431
|
-
|
|
75432
|
-
if (!isFinite(value)) {
|
|
75433
|
-
return numberType;
|
|
75434
|
-
}
|
|
75435
|
-
return getFreshTypeOfLiteralType(getNumberLiteralType(value));
|
|
75436
|
-
}
|
|
75422
|
+
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
75437
75423
|
case 10 /* BigIntLiteral */:
|
|
75438
75424
|
checkGrammarBigIntLiteral(node);
|
|
75439
75425
|
return getFreshTypeOfLiteralType(getBigIntLiteralType({
|
|
@@ -75550,7 +75536,7 @@ function createTypeChecker(host) {
|
|
|
75550
75536
|
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
75551
75537
|
if (modifiers) {
|
|
75552
75538
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
75553
|
-
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
75539
|
+
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
75554
75540
|
error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
75555
75541
|
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
75556
75542
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
@@ -80338,6 +80324,16 @@ function createTypeChecker(host) {
|
|
|
80338
80324
|
if (targetFlags & excludedMeanings) {
|
|
80339
80325
|
const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
|
|
80340
80326
|
error(node, message, symbolToString(symbol));
|
|
80327
|
+
} else if (node.kind !== 281 /* ExportSpecifier */) {
|
|
80328
|
+
const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration);
|
|
80329
|
+
if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) {
|
|
80330
|
+
error(
|
|
80331
|
+
node,
|
|
80332
|
+
Diagnostics.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,
|
|
80333
|
+
symbolToString(symbol),
|
|
80334
|
+
isolatedModulesLikeFlagName
|
|
80335
|
+
);
|
|
80336
|
+
}
|
|
80341
80337
|
}
|
|
80342
80338
|
if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) {
|
|
80343
80339
|
const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
|
|
@@ -82434,7 +82430,7 @@ function createTypeChecker(host) {
|
|
|
82434
82430
|
if (enumResult)
|
|
82435
82431
|
return enumResult;
|
|
82436
82432
|
const literalValue = type.value;
|
|
82437
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
82433
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
|
|
82438
82434
|
}
|
|
82439
82435
|
function createLiteralConstValue(node, tracker) {
|
|
82440
82436
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -88863,7 +88859,7 @@ function transformTypeScript(context) {
|
|
|
88863
88859
|
function transformEnumMemberDeclarationValue(member) {
|
|
88864
88860
|
const value = resolver.getConstantValue(member);
|
|
88865
88861
|
if (value !== void 0) {
|
|
88866
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) :
|
|
88862
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
88867
88863
|
} else {
|
|
88868
88864
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
88869
88865
|
if (member.initializer) {
|
|
@@ -103183,7 +103179,7 @@ function transformGenerators(context) {
|
|
|
103183
103179
|
if (labelExpressions === void 0) {
|
|
103184
103180
|
labelExpressions = [];
|
|
103185
103181
|
}
|
|
103186
|
-
const expression = factory2.createNumericLiteral(
|
|
103182
|
+
const expression = factory2.createNumericLiteral(-1);
|
|
103187
103183
|
if (labelExpressions[label] === void 0) {
|
|
103188
103184
|
labelExpressions[label] = [expression];
|
|
103189
103185
|
} else {
|
|
@@ -109058,8 +109054,7 @@ function transformDeclarations(context) {
|
|
|
109058
109054
|
if (shouldStripInternal(m))
|
|
109059
109055
|
return;
|
|
109060
109056
|
const constValue = resolver.getConstantValue(m);
|
|
109061
|
-
|
|
109062
|
-
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
109057
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
|
|
109063
109058
|
}))
|
|
109064
109059
|
));
|
|
109065
109060
|
}
|
package/lib/tsserver.js
CHANGED
|
@@ -10214,6 +10214,7 @@ var Diagnostics = {
|
|
|
10214
10214
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
10215
10215
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
10216
10216
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
10217
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
10217
10218
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
10218
10219
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
10219
10220
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -14658,7 +14659,7 @@ function isPropertyAccessOrQualifiedName(node) {
|
|
|
14658
14659
|
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
|
|
14659
14660
|
}
|
|
14660
14661
|
function isCallLikeOrFunctionLikeExpression(node) {
|
|
14661
|
-
return isCallLikeExpression(node) ||
|
|
14662
|
+
return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node);
|
|
14662
14663
|
}
|
|
14663
14664
|
function isCallLikeExpression(node) {
|
|
14664
14665
|
switch (node.kind) {
|
|
@@ -23050,10 +23051,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23050
23051
|
return update(updated, original);
|
|
23051
23052
|
}
|
|
23052
23053
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
23053
|
-
const text = typeof value === "number" ? value + "" : value;
|
|
23054
|
-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
23055
23054
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
23056
|
-
node.text =
|
|
23055
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
23057
23056
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
23058
23057
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
23059
23058
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -48415,7 +48414,7 @@ function createTypeChecker(host) {
|
|
|
48415
48414
|
const nodeLinks2 = getNodeLinks(node);
|
|
48416
48415
|
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
|
|
48417
48416
|
nodeLinks2.resolvedSignature = void 0;
|
|
48418
|
-
if (
|
|
48417
|
+
if (isFunctionExpressionOrArrowFunction(node)) {
|
|
48419
48418
|
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
|
|
48420
48419
|
const type = symbolLinks2.type;
|
|
48421
48420
|
cachedTypes2.push([symbolLinks2, type]);
|
|
@@ -54243,7 +54242,7 @@ function createTypeChecker(host) {
|
|
|
54243
54242
|
return factory.createStringLiteral(name, !!singleQuote);
|
|
54244
54243
|
}
|
|
54245
54244
|
if (isNumericLiteralName(name) && startsWith(name, "-")) {
|
|
54246
|
-
return factory.createComputedPropertyName(factory.
|
|
54245
|
+
return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
|
|
54247
54246
|
}
|
|
54248
54247
|
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
|
|
54249
54248
|
}
|
|
@@ -58946,14 +58945,6 @@ function createTypeChecker(host) {
|
|
|
58946
58945
|
return getCheckFlags(s) & 4096 /* Late */;
|
|
58947
58946
|
}
|
|
58948
58947
|
function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
|
|
58949
|
-
if (isTupleType(type)) {
|
|
58950
|
-
forEachType(getUnionType(getElementTypes(type).map((_, i) => getStringLiteralType("" + i))), cb);
|
|
58951
|
-
return;
|
|
58952
|
-
}
|
|
58953
|
-
if (isArrayType(type)) {
|
|
58954
|
-
cb(numberType);
|
|
58955
|
-
return;
|
|
58956
|
-
}
|
|
58957
58948
|
for (const prop of getPropertiesOfType(type)) {
|
|
58958
58949
|
cb(getLiteralTypeFromProperty(prop, include));
|
|
58959
58950
|
}
|
|
@@ -60790,7 +60781,7 @@ function createTypeChecker(host) {
|
|
|
60790
60781
|
if (constraint) {
|
|
60791
60782
|
constraints = append(constraints, constraint);
|
|
60792
60783
|
}
|
|
60793
|
-
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ &&
|
|
60784
|
+
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && node === parent2.type) {
|
|
60794
60785
|
const mappedType = getTypeFromTypeNode(parent2);
|
|
60795
60786
|
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
|
|
60796
60787
|
const typeParameter = getHomomorphicTypeVariable(mappedType);
|
|
@@ -80134,14 +80125,9 @@ function createTypeChecker(host) {
|
|
|
80134
80125
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
80135
80126
|
case 11 /* StringLiteral */:
|
|
80136
80127
|
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
80137
|
-
case 9 /* NumericLiteral */:
|
|
80128
|
+
case 9 /* NumericLiteral */:
|
|
80138
80129
|
checkGrammarNumericLiteral(node);
|
|
80139
|
-
|
|
80140
|
-
if (!isFinite(value)) {
|
|
80141
|
-
return numberType;
|
|
80142
|
-
}
|
|
80143
|
-
return getFreshTypeOfLiteralType(getNumberLiteralType(value));
|
|
80144
|
-
}
|
|
80130
|
+
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
80145
80131
|
case 10 /* BigIntLiteral */:
|
|
80146
80132
|
checkGrammarBigIntLiteral(node);
|
|
80147
80133
|
return getFreshTypeOfLiteralType(getBigIntLiteralType({
|
|
@@ -80258,7 +80244,7 @@ function createTypeChecker(host) {
|
|
|
80258
80244
|
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
80259
80245
|
if (modifiers) {
|
|
80260
80246
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
80261
|
-
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
80247
|
+
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
80262
80248
|
error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
80263
80249
|
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
80264
80250
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
@@ -85046,6 +85032,16 @@ function createTypeChecker(host) {
|
|
|
85046
85032
|
if (targetFlags & excludedMeanings) {
|
|
85047
85033
|
const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
|
|
85048
85034
|
error2(node, message, symbolToString(symbol));
|
|
85035
|
+
} else if (node.kind !== 281 /* ExportSpecifier */) {
|
|
85036
|
+
const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration);
|
|
85037
|
+
if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) {
|
|
85038
|
+
error2(
|
|
85039
|
+
node,
|
|
85040
|
+
Diagnostics.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,
|
|
85041
|
+
symbolToString(symbol),
|
|
85042
|
+
isolatedModulesLikeFlagName
|
|
85043
|
+
);
|
|
85044
|
+
}
|
|
85049
85045
|
}
|
|
85050
85046
|
if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) {
|
|
85051
85047
|
const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
|
|
@@ -87142,7 +87138,7 @@ function createTypeChecker(host) {
|
|
|
87142
87138
|
if (enumResult)
|
|
87143
87139
|
return enumResult;
|
|
87144
87140
|
const literalValue = type.value;
|
|
87145
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
87141
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
|
|
87146
87142
|
}
|
|
87147
87143
|
function createLiteralConstValue(node, tracker) {
|
|
87148
87144
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -93742,7 +93738,7 @@ function transformTypeScript(context) {
|
|
|
93742
93738
|
function transformEnumMemberDeclarationValue(member) {
|
|
93743
93739
|
const value = resolver.getConstantValue(member);
|
|
93744
93740
|
if (value !== void 0) {
|
|
93745
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) :
|
|
93741
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
93746
93742
|
} else {
|
|
93747
93743
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
93748
93744
|
if (member.initializer) {
|
|
@@ -108062,7 +108058,7 @@ function transformGenerators(context) {
|
|
|
108062
108058
|
if (labelExpressions === void 0) {
|
|
108063
108059
|
labelExpressions = [];
|
|
108064
108060
|
}
|
|
108065
|
-
const expression = factory2.createNumericLiteral(
|
|
108061
|
+
const expression = factory2.createNumericLiteral(-1);
|
|
108066
108062
|
if (labelExpressions[label] === void 0) {
|
|
108067
108063
|
labelExpressions[label] = [expression];
|
|
108068
108064
|
} else {
|
|
@@ -113937,8 +113933,7 @@ function transformDeclarations(context) {
|
|
|
113937
113933
|
if (shouldStripInternal(m))
|
|
113938
113934
|
return;
|
|
113939
113935
|
const constValue = resolver.getConstantValue(m);
|
|
113940
|
-
|
|
113941
|
-
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
113936
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
|
|
113942
113937
|
}))
|
|
113943
113938
|
));
|
|
113944
113939
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -7994,6 +7994,7 @@ ${lanes.join("\n")}
|
|
|
7994
7994
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
7995
7995
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
7996
7996
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
7997
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
7997
7998
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
7998
7999
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
7999
8000
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -12445,7 +12446,7 @@ ${lanes.join("\n")}
|
|
|
12445
12446
|
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
|
|
12446
12447
|
}
|
|
12447
12448
|
function isCallLikeOrFunctionLikeExpression(node) {
|
|
12448
|
-
return isCallLikeExpression(node) ||
|
|
12449
|
+
return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node);
|
|
12449
12450
|
}
|
|
12450
12451
|
function isCallLikeExpression(node) {
|
|
12451
12452
|
switch (node.kind) {
|
|
@@ -20862,10 +20863,8 @@ ${lanes.join("\n")}
|
|
|
20862
20863
|
return update(updated, original);
|
|
20863
20864
|
}
|
|
20864
20865
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
20865
|
-
const text = typeof value === "number" ? value + "" : value;
|
|
20866
|
-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
20867
20866
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
20868
|
-
node.text =
|
|
20867
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
20869
20868
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
20870
20869
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
20871
20870
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -46180,7 +46179,7 @@ ${lanes.join("\n")}
|
|
|
46180
46179
|
const nodeLinks2 = getNodeLinks(node);
|
|
46181
46180
|
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
|
|
46182
46181
|
nodeLinks2.resolvedSignature = void 0;
|
|
46183
|
-
if (
|
|
46182
|
+
if (isFunctionExpressionOrArrowFunction(node)) {
|
|
46184
46183
|
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
|
|
46185
46184
|
const type = symbolLinks2.type;
|
|
46186
46185
|
cachedTypes2.push([symbolLinks2, type]);
|
|
@@ -52008,7 +52007,7 @@ ${lanes.join("\n")}
|
|
|
52008
52007
|
return factory.createStringLiteral(name, !!singleQuote);
|
|
52009
52008
|
}
|
|
52010
52009
|
if (isNumericLiteralName(name) && startsWith(name, "-")) {
|
|
52011
|
-
return factory.createComputedPropertyName(factory.
|
|
52010
|
+
return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
|
|
52012
52011
|
}
|
|
52013
52012
|
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
|
|
52014
52013
|
}
|
|
@@ -56711,14 +56710,6 @@ ${lanes.join("\n")}
|
|
|
56711
56710
|
return getCheckFlags(s) & 4096 /* Late */;
|
|
56712
56711
|
}
|
|
56713
56712
|
function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
|
|
56714
|
-
if (isTupleType(type)) {
|
|
56715
|
-
forEachType(getUnionType(getElementTypes(type).map((_, i) => getStringLiteralType("" + i))), cb);
|
|
56716
|
-
return;
|
|
56717
|
-
}
|
|
56718
|
-
if (isArrayType(type)) {
|
|
56719
|
-
cb(numberType);
|
|
56720
|
-
return;
|
|
56721
|
-
}
|
|
56722
56713
|
for (const prop of getPropertiesOfType(type)) {
|
|
56723
56714
|
cb(getLiteralTypeFromProperty(prop, include));
|
|
56724
56715
|
}
|
|
@@ -58555,7 +58546,7 @@ ${lanes.join("\n")}
|
|
|
58555
58546
|
if (constraint) {
|
|
58556
58547
|
constraints = append(constraints, constraint);
|
|
58557
58548
|
}
|
|
58558
|
-
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ &&
|
|
58549
|
+
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && node === parent2.type) {
|
|
58559
58550
|
const mappedType = getTypeFromTypeNode(parent2);
|
|
58560
58551
|
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
|
|
58561
58552
|
const typeParameter = getHomomorphicTypeVariable(mappedType);
|
|
@@ -77899,14 +77890,9 @@ ${lanes.join("\n")}
|
|
|
77899
77890
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
77900
77891
|
case 11 /* StringLiteral */:
|
|
77901
77892
|
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
77902
|
-
case 9 /* NumericLiteral */:
|
|
77893
|
+
case 9 /* NumericLiteral */:
|
|
77903
77894
|
checkGrammarNumericLiteral(node);
|
|
77904
|
-
|
|
77905
|
-
if (!isFinite(value)) {
|
|
77906
|
-
return numberType;
|
|
77907
|
-
}
|
|
77908
|
-
return getFreshTypeOfLiteralType(getNumberLiteralType(value));
|
|
77909
|
-
}
|
|
77895
|
+
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
77910
77896
|
case 10 /* BigIntLiteral */:
|
|
77911
77897
|
checkGrammarBigIntLiteral(node);
|
|
77912
77898
|
return getFreshTypeOfLiteralType(getBigIntLiteralType({
|
|
@@ -78023,7 +78009,7 @@ ${lanes.join("\n")}
|
|
|
78023
78009
|
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
78024
78010
|
if (modifiers) {
|
|
78025
78011
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
78026
|
-
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
78012
|
+
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
78027
78013
|
error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
78028
78014
|
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
78029
78015
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
@@ -82811,6 +82797,16 @@ ${lanes.join("\n")}
|
|
|
82811
82797
|
if (targetFlags & excludedMeanings) {
|
|
82812
82798
|
const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
|
|
82813
82799
|
error2(node, message, symbolToString(symbol));
|
|
82800
|
+
} else if (node.kind !== 281 /* ExportSpecifier */) {
|
|
82801
|
+
const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration);
|
|
82802
|
+
if (appearsValueyToTranspiler && symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */)) {
|
|
82803
|
+
error2(
|
|
82804
|
+
node,
|
|
82805
|
+
Diagnostics.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,
|
|
82806
|
+
symbolToString(symbol),
|
|
82807
|
+
isolatedModulesLikeFlagName
|
|
82808
|
+
);
|
|
82809
|
+
}
|
|
82814
82810
|
}
|
|
82815
82811
|
if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) {
|
|
82816
82812
|
const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
|
|
@@ -84907,7 +84903,7 @@ ${lanes.join("\n")}
|
|
|
84907
84903
|
if (enumResult)
|
|
84908
84904
|
return enumResult;
|
|
84909
84905
|
const literalValue = type.value;
|
|
84910
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
84906
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
|
|
84911
84907
|
}
|
|
84912
84908
|
function createLiteralConstValue(node, tracker) {
|
|
84913
84909
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -91687,7 +91683,7 @@ ${lanes.join("\n")}
|
|
|
91687
91683
|
function transformEnumMemberDeclarationValue(member) {
|
|
91688
91684
|
const value = resolver.getConstantValue(member);
|
|
91689
91685
|
if (value !== void 0) {
|
|
91690
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) :
|
|
91686
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
91691
91687
|
} else {
|
|
91692
91688
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
91693
91689
|
if (member.initializer) {
|
|
@@ -106100,7 +106096,7 @@ ${lanes.join("\n")}
|
|
|
106100
106096
|
if (labelExpressions === void 0) {
|
|
106101
106097
|
labelExpressions = [];
|
|
106102
106098
|
}
|
|
106103
|
-
const expression = factory2.createNumericLiteral(
|
|
106099
|
+
const expression = factory2.createNumericLiteral(-1);
|
|
106104
106100
|
if (labelExpressions[label] === void 0) {
|
|
106105
106101
|
labelExpressions[label] = [expression];
|
|
106106
106102
|
} else {
|
|
@@ -112011,8 +112007,7 @@ ${lanes.join("\n")}
|
|
|
112011
112007
|
if (shouldStripInternal(m))
|
|
112012
112008
|
return;
|
|
112013
112009
|
const constValue = resolver.getConstantValue(m);
|
|
112014
|
-
|
|
112015
|
-
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
112010
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
|
|
112016
112011
|
}))
|
|
112017
112012
|
));
|
|
112018
112013
|
}
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -6059,6 +6059,7 @@ var Diagnostics = {
|
|
|
6059
6059
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
6060
6060
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
6061
6061
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
6062
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
6062
6063
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6063
6064
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
6064
6065
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -13056,10 +13057,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13056
13057
|
return update(updated, original);
|
|
13057
13058
|
}
|
|
13058
13059
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
13059
|
-
const text = typeof value === "number" ? value + "" : value;
|
|
13060
|
-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
13061
13060
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
13062
|
-
node.text =
|
|
13061
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
13063
13062
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
13064
13063
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
13065
13064
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
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-56418-6",
|
|
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": "66b933eedd4e6149c1a51829ee6d2047ff00c8d2"
|
|
119
119
|
}
|