Skip to content

Commit 44a5343

Browse files
committed
Upate error message
1 parent 7430f3c commit 44a5343

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,7 +2073,7 @@ module ts {
20732073
}
20742074
// Handle export default expressions
20752075
if (declaration.kind === SyntaxKind.ExportAssignment) {
2076-
var exportAssignment = (<ExportAssignment>declaration);
2076+
var exportAssignment = <ExportAssignment>declaration;
20772077
if (exportAssignment.expression) {
20782078
return links.type = checkExpression(exportAssignment.expression);
20792079
}
@@ -10095,7 +10095,7 @@ module ts {
1009510095
if (node.type) {
1009610096
checkSourceElement(node.type);
1009710097
if (!isInAmbientContext(node)) {
10098-
grammarErrorOnFirstToken(node.type, Diagnostics.Type_annotation_on_export_statements_are_only_allowed_in_ambient_module_declarations);
10098+
grammarErrorOnFirstToken(node.type, Diagnostics.A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration);
1009910099
}
1010010100
}
1010110101

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ module ts {
157157
Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." },
158158
An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: DiagnosticCategory.Error, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." },
159159
Unterminated_Unicode_escape_sequence: { code: 1199, category: DiagnosticCategory.Error, key: "Unterminated Unicode escape sequence." },
160-
Type_annotation_on_export_statements_are_only_allowed_in_ambient_module_declarations: { code: 1200, category: DiagnosticCategory.Error, key: "Type annotation on export statements are only allowed in ambient module declarations." },
160+
A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration: { code: 1200, category: DiagnosticCategory.Error, key: "A type annotation on an export statement is only allowed in an ambient external module declaration." },
161161
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
162162
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." },
163163
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@
619619
"category": "Error",
620620
"code": 1199
621621
},
622-
"Type annotation on export statements are only allowed in ambient module declarations.": {
622+
"A type annotation on an export statement is only allowed in an ambient external module declaration.": {
623623
"category": "Error",
624624
"code": 1200
625625
},
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
tests/cases/compiler/exportDefaultTypeAnnoation.ts(2,18): error TS1200: Type annotation on export statements are only allowed in ambient module declarations.
1+
tests/cases/compiler/exportDefaultTypeAnnoation.ts(2,18): error TS1200: A type annotation on an export statement is only allowed in an ambient external module declaration.
22

33

44
==== tests/cases/compiler/exportDefaultTypeAnnoation.ts (1 errors) ====
55

66
export default : number;
77
~~~~~~
8-
!!! error TS1200: Type annotation on export statements are only allowed in ambient module declarations.
8+
!!! error TS1200: A type annotation on an export statement is only allowed in an ambient external module declaration.

0 commit comments

Comments
 (0)