Upate error message
This commit is contained in:
parent
7430f3c9c7
commit
44a5343c1e
|
@ -2073,7 +2073,7 @@ module ts {
|
||||||
}
|
}
|
||||||
// Handle export default expressions
|
// Handle export default expressions
|
||||||
if (declaration.kind === SyntaxKind.ExportAssignment) {
|
if (declaration.kind === SyntaxKind.ExportAssignment) {
|
||||||
var exportAssignment = (<ExportAssignment>declaration);
|
var exportAssignment = <ExportAssignment>declaration;
|
||||||
if (exportAssignment.expression) {
|
if (exportAssignment.expression) {
|
||||||
return links.type = checkExpression(exportAssignment.expression);
|
return links.type = checkExpression(exportAssignment.expression);
|
||||||
}
|
}
|
||||||
|
@ -10095,7 +10095,7 @@ module ts {
|
||||||
if (node.type) {
|
if (node.type) {
|
||||||
checkSourceElement(node.type);
|
checkSourceElement(node.type);
|
||||||
if (!isInAmbientContext(node)) {
|
if (!isInAmbientContext(node)) {
|
||||||
grammarErrorOnFirstToken(node.type, Diagnostics.Type_annotation_on_export_statements_are_only_allowed_in_ambient_module_declarations);
|
grammarErrorOnFirstToken(node.type, Diagnostics.A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ module ts {
|
||||||
Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." },
|
Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." },
|
||||||
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." },
|
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." },
|
||||||
Unterminated_Unicode_escape_sequence: { code: 1199, category: DiagnosticCategory.Error, key: "Unterminated Unicode escape sequence." },
|
Unterminated_Unicode_escape_sequence: { code: 1199, category: DiagnosticCategory.Error, key: "Unterminated Unicode escape sequence." },
|
||||||
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." },
|
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." },
|
||||||
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
|
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
|
||||||
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." },
|
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." },
|
||||||
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
|
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
|
||||||
|
|
|
@ -619,7 +619,7 @@
|
||||||
"category": "Error",
|
"category": "Error",
|
||||||
"code": 1199
|
"code": 1199
|
||||||
},
|
},
|
||||||
"Type annotation on export statements are only allowed in ambient module declarations.": {
|
"A type annotation on an export statement is only allowed in an ambient external module declaration.": {
|
||||||
"category": "Error",
|
"category": "Error",
|
||||||
"code": 1200
|
"code": 1200
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
tests/cases/compiler/exportDefaultTypeAnnoation.ts(2,18): error TS1200: Type annotation on export statements are only allowed in ambient module declarations.
|
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.
|
||||||
|
|
||||||
|
|
||||||
==== tests/cases/compiler/exportDefaultTypeAnnoation.ts (1 errors) ====
|
==== tests/cases/compiler/exportDefaultTypeAnnoation.ts (1 errors) ====
|
||||||
|
|
||||||
export default : number;
|
export default : number;
|
||||||
~~~~~~
|
~~~~~~
|
||||||
!!! error TS1200: Type annotation on export statements are only allowed in ambient module declarations.
|
!!! error TS1200: A type annotation on an export statement is only allowed in an ambient external module declaration.
|
Loading…
Reference in a new issue