Skip to content

Commit d793658

Browse files
committed
Change Symbol to symbol in error messages
1 parent 59a704e commit d793658

File tree

67 files changed

+254
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+254
-254
lines changed

src/compiler/checker.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5535,7 +5535,7 @@ module ts {
55355535
// This will allow types number, string, Symbol or any. It will also allow enums, the unknown
55365536
// type, and any union of these types (like string | number).
55375537
if (!isTypeOfKind(links.resolvedType, TypeFlags.Any | TypeFlags.NumberLike | TypeFlags.StringLike | TypeFlags.ESSymbol)) {
5538-
error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_Symbol_or_any);
5538+
error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);
55395539
}
55405540
}
55415541

@@ -10526,12 +10526,12 @@ module ts {
1052610526
if (parameter.type.kind !== SyntaxKind.StringKeyword && parameter.type.kind !== SyntaxKind.NumberKeyword) {
1052710527
if (parameter.type.kind === SyntaxKind.SymbolKeyword) {
1052810528
if (languageVersion < ScriptTarget.ES6) {
10529-
return grammarErrorOnNode(parameter.type, Diagnostics.Symbol_indexers_are_only_available_when_targeting_ECMAScript_6_and_higher);
10529+
return grammarErrorOnNode(parameter.type, Diagnostics.symbol_indexers_are_only_available_when_targeting_ECMAScript_6_and_higher);
1053010530
}
1053110531
// No error for parameter type
1053210532
}
1053310533
else {
10534-
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_number_or_Symbol);
10534+
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_number_or_symbol);
1053510535
}
1053610536
}
1053710537
if (!node.type) {
@@ -10839,17 +10839,17 @@ module ts {
1083910839
// and accessors are not allowed in ambient contexts in general,
1084010840
// so this error only really matters for methods.
1084110841
if (isInAmbientContext(node)) {
10842-
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_Symbol);
10842+
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol);
1084310843
}
1084410844
else if (!node.body) {
10845-
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_Symbol);
10845+
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol);
1084610846
}
1084710847
}
1084810848
else if (node.parent.kind === SyntaxKind.InterfaceDeclaration) {
10849-
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_Symbol);
10849+
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol);
1085010850
}
1085110851
else if (node.parent.kind === SyntaxKind.TypeLiteral) {
10852-
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_Symbol);
10852+
return checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol);
1085310853
}
1085410854
}
1085510855

@@ -11120,17 +11120,17 @@ module ts {
1112011120
function checkGrammarProperty(node: PropertyDeclaration) {
1112111121
if (node.parent.kind === SyntaxKind.ClassDeclaration) {
1112211122
if (checkGrammarForInvalidQuestionMark(node, node.questionToken, Diagnostics.A_class_member_cannot_be_declared_optional) ||
11123-
checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_Symbol)) {
11123+
checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) {
1112411124
return true;
1112511125
}
1112611126
}
1112711127
else if (node.parent.kind === SyntaxKind.InterfaceDeclaration) {
11128-
if (checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_Symbol)) {
11128+
if (checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) {
1112911129
return true;
1113011130
}
1113111131
}
1113211132
else if (node.parent.kind === SyntaxKind.TypeLiteral) {
11133-
if (checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_Symbol)) {
11133+
if (checkGrammarForNonSymbolComputedProperty(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) {
1113411134
return true;
1113511135
}
1113611136
}

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module ts {
1919
An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have an initializer." },
2020
An_index_signature_must_have_a_type_annotation: { code: 1021, category: DiagnosticCategory.Error, key: "An index signature must have a type annotation." },
2121
An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." },
22-
An_index_signature_parameter_type_must_be_string_number_or_Symbol: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string', 'number', or 'Symbol'." },
22+
An_index_signature_parameter_type_must_be_string_number_or_symbol: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string', 'number', or 'symbol'." },
2323
A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." },
2424
An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: DiagnosticCategory.Error, key: "An 'extends' clause must precede an 'implements' clause." },
2525
A_class_can_only_extend_a_single_class: { code: 1026, category: DiagnosticCategory.Error, key: "A class can only extend a single class." },
@@ -123,12 +123,12 @@ module ts {
123123
An_object_member_cannot_be_declared_optional: { code: 1162, category: DiagnosticCategory.Error, key: "An object member cannot be declared optional." },
124124
yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration." },
125125
Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in enums." },
126-
A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_Symbol: { code: 1165, category: DiagnosticCategory.Error, key: "A computed property name in an ambient context must directly refer to a built-in Symbol." },
127-
A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_Symbol: { code: 1166, category: DiagnosticCategory.Error, key: "A computed property name in a class property declaration must directly refer to a built-in Symbol." },
126+
A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: DiagnosticCategory.Error, key: "A computed property name in an ambient context must directly refer to a built-in symbol." },
127+
A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: DiagnosticCategory.Error, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." },
128128
Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: DiagnosticCategory.Error, key: "Computed property names are only available when targeting ECMAScript 6 and higher." },
129-
A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_Symbol: { code: 1168, category: DiagnosticCategory.Error, key: "A computed property name in a method overload must directly refer to a built-in Symbol." },
130-
A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_Symbol: { code: 1169, category: DiagnosticCategory.Error, key: "A computed property name in an interface must directly refer to a built-in Symbol." },
131-
A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_Symbol: { code: 1170, category: DiagnosticCategory.Error, key: "A computed property name in a type literal must directly refer to a built-in Symbol." },
129+
A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: DiagnosticCategory.Error, key: "A computed property name in a method overload must directly refer to a built-in symbol." },
130+
A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: DiagnosticCategory.Error, key: "A computed property name in an interface must directly refer to a built-in symbol." },
131+
A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: DiagnosticCategory.Error, key: "A computed property name in a type literal must directly refer to a built-in symbol." },
132132
A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: DiagnosticCategory.Error, key: "A comma expression is not allowed in a computed property name." },
133133
extends_clause_already_seen: { code: 1172, category: DiagnosticCategory.Error, key: "'extends' clause already seen." },
134134
extends_clause_must_precede_implements_clause: { code: 1173, category: DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." },
@@ -147,7 +147,7 @@ module ts {
147147
Merge_conflict_marker_encountered: { code: 1185, category: DiagnosticCategory.Error, key: "Merge conflict marker encountered." },
148148
A_rest_element_cannot_have_an_initializer: { code: 1186, category: DiagnosticCategory.Error, key: "A rest element cannot have an initializer." },
149149
A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: DiagnosticCategory.Error, key: "A parameter property may not be a binding pattern." },
150-
Symbol_indexers_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1188, category: DiagnosticCategory.Error, key: "'Symbol' indexers are only available when targeting ECMAScript 6 and higher.", isEarly: true },
150+
symbol_indexers_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1188, category: DiagnosticCategory.Error, key: "'symbol' indexers are only available when targeting ECMAScript 6 and higher.", isEarly: true },
151151
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
152152
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
153153
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -300,10 +300,10 @@ module ts {
300300
Type_0_is_not_an_array_type: { code: 2461, category: DiagnosticCategory.Error, key: "Type '{0}' is not an array type." },
301301
A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: DiagnosticCategory.Error, key: "A rest element must be last in an array destructuring pattern" },
302302
A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: DiagnosticCategory.Error, key: "A binding pattern parameter cannot be optional in an implementation signature." },
303-
A_computed_property_name_must_be_of_type_string_number_Symbol_or_any: { code: 2464, category: DiagnosticCategory.Error, key: "A computed property name must be of type 'string', 'number', 'Symbol', or 'any'." },
303+
A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: DiagnosticCategory.Error, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." },
304304
this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a computed property name." },
305305
super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: DiagnosticCategory.Error, key: "'super' cannot be referenced in a computed property name." },
306-
A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2466, category: DiagnosticCategory.Error, key: "A computed property name cannot reference a type parameter from its containing type." },
306+
A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: DiagnosticCategory.Error, key: "A computed property name cannot reference a type parameter from its containing type." },
307307
Cannot_find_global_value_0: { code: 2468, category: DiagnosticCategory.Error, key: "Cannot find global value '{0}'." },
308308
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
309309
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },

src/compiler/diagnosticMessages.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"category": "Error",
6868
"code": 1022
6969
},
70-
"An index signature parameter type must be 'string', 'number', or 'Symbol'.": {
70+
"An index signature parameter type must be 'string', 'number', or 'symbol'.": {
7171
"category": "Error",
7272
"code": 1023
7373
},
@@ -483,27 +483,27 @@
483483
"category": "Error",
484484
"code": 1164
485485
},
486-
"A computed property name in an ambient context must directly refer to a built-in Symbol.": {
486+
"A computed property name in an ambient context must directly refer to a built-in symbol.": {
487487
"category": "Error",
488488
"code": 1165
489489
},
490-
"A computed property name in a class property declaration must directly refer to a built-in Symbol.": {
490+
"A computed property name in a class property declaration must directly refer to a built-in symbol.": {
491491
"category": "Error",
492492
"code": 1166
493493
},
494494
"Computed property names are only available when targeting ECMAScript 6 and higher.": {
495495
"category": "Error",
496496
"code": 1167
497497
},
498-
"A computed property name in a method overload must directly refer to a built-in Symbol.": {
498+
"A computed property name in a method overload must directly refer to a built-in symbol.": {
499499
"category": "Error",
500500
"code": 1168
501501
},
502-
"A computed property name in an interface must directly refer to a built-in Symbol.": {
502+
"A computed property name in an interface must directly refer to a built-in symbol.": {
503503
"category": "Error",
504504
"code": 1169
505505
},
506-
"A computed property name in a type literal must directly refer to a built-in Symbol.": {
506+
"A computed property name in a type literal must directly refer to a built-in symbol.": {
507507
"category": "Error",
508508
"code": 1170
509509
},
@@ -579,7 +579,7 @@
579579
"category": "Error",
580580
"code": 1187
581581
},
582-
"'Symbol' indexers are only available when targeting ECMAScript 6 and higher.": {
582+
"'symbol' indexers are only available when targeting ECMAScript 6 and higher.": {
583583
"category": "Error",
584584
"code": 1188,
585585
"isEarly": true
@@ -1193,7 +1193,7 @@
11931193
"category": "Error",
11941194
"code": 2463
11951195
},
1196-
"A computed property name must be of type 'string', 'number', 'Symbol', or 'any'.": {
1196+
"A computed property name must be of type 'string', 'number', 'symbol', or 'any'.": {
11971197
"category": "Error",
11981198
"code": 2464
11991199
},
@@ -1207,7 +1207,7 @@
12071207
},
12081208
"A computed property name cannot reference a type parameter from its containing type.": {
12091209
"category": "Error",
1210-
"code": 2466
1210+
"code": 2467
12111211
},
12121212
"Cannot find global value '{0}'.": {
12131213
"category": "Error",

tests/baselines/reference/arraySigChecking.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/arraySigChecking.ts(11,17): error TS1023: An index signature parameter type must be 'string', 'number', or 'Symbol'.
1+
tests/cases/compiler/arraySigChecking.ts(11,17): error TS1023: An index signature parameter type must be 'string', 'number', or 'symbol'.
22
tests/cases/compiler/arraySigChecking.ts(18,5): error TS2322: Type 'void[]' is not assignable to type 'string[]'.
33
Type 'void' is not assignable to type 'string'.
44
tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'.
@@ -20,7 +20,7 @@ tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]'
2020

2121
var foo: { [index: any]; }; // expect an error here
2222
~~~~~
23-
!!! error TS1023: An index signature parameter type must be 'string', 'number', or 'Symbol'.
23+
!!! error TS1023: An index signature parameter type must be 'string', 'number', or 'symbol'.
2424
}
2525

2626
interface myInt {

0 commit comments

Comments
 (0)