Skip to content

Commit 92b3677

Browse files
committed
Adding error message for empty tuple types.
1 parent ef52312 commit 92b3677

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ module ts {
106106
An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: DiagnosticCategory.Error, key: "An object literal cannot have property and accessor with the same name." },
107107
An_export_assignment_cannot_have_modifiers: { code: 1120, category: DiagnosticCategory.Error, key: "An export assignment cannot have modifiers." },
108108
Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: DiagnosticCategory.Error, key: "Octal literals are not allowed in strict mode." },
109+
A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: DiagnosticCategory.Error, key: "A tuple type element list cannot be empty." },
109110
Duplicate_identifier_0: { code: 2000, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
110111
Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 2018, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." },
111112
Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 2019, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." },

src/compiler/diagnosticMessages.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,10 @@
416416
"category": "Error",
417417
"code": 1121
418418
},
419+
"A tuple type element list cannot be empty.": {
420+
"category": "Error",
421+
"code": 1122
422+
},
419423
"Duplicate identifier '{0}'.": {
420424
"category": "Error",
421425
"code": 2000
@@ -1042,7 +1046,7 @@
10421046
"File change detected. Compiling...": {
10431047
"category": "Message",
10441048
"code": 6032
1045-
},
1049+
},
10461050
"STRING": {
10471051
"category": "Message",
10481052
"code": 6033
@@ -1078,8 +1082,8 @@
10781082
"Additional locations:": {
10791083
"category": "Message",
10801084
"code": 6041
1081-
},
1082-
"Compilation complete. Watching for file changes.": {
1085+
},
1086+
"Compilation complete. Watching for file changes.": {
10831087
"category": "Message",
10841088
"code": 6042
10851089
},

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ module ts {
14021402
var startErrorCount = file.syntacticErrors.length;
14031403
node.elementTypes = parseBracketedList(ParsingContext.TupleElementTypes, parseType, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken);
14041404
if (!node.elementTypes.length && file.syntacticErrors.length === startErrorCount) {
1405-
grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, Diagnostics.Type_argument_list_cannot_be_empty);
1405+
grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, Diagnostics.A_tuple_type_element_list_cannot_be_empty);
14061406
}
14071407
return finishNode(node);
14081408
}

0 commit comments

Comments
 (0)