Updated error message

This commit is contained in:
Arthur Ozga
2015-06-03 14:11:13 -07:00
parent 2b899f129a
commit 29c9286cbc
3 changed files with 5 additions and 9 deletions

View File

@@ -10417,7 +10417,7 @@ module ts {
// Non-ambient classes cannot merge with interfaces.
if (!(node.flags & NodeFlags.Ambient) && symbol.flags & SymbolFlags.Interface) {
error(node, Diagnostics.A_non_ambient_class_cannot_be_merged_with_an_interface)
error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface)
}
forEach(node.members, checkSourceElement);
@@ -10600,10 +10600,11 @@ module ts {
}
}
// Interfaces cannot merge with non-ambient classes.
if (symbol && symbol.declarations) {
for (let declaration of symbol.declarations) {
if (declaration.kind === SyntaxKind.ClassDeclaration && !(declaration.flags & NodeFlags.Ambient)) {
error(node, Diagnostics.An_interface_cannot_merge_with_a_non_ambient_class);
error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
break;
}
}

View File

@@ -372,8 +372,7 @@ module ts {
Cannot_find_namespace_0: { code: 2503, category: DiagnosticCategory.Error, key: "Cannot find namespace '{0}'." },
No_best_common_type_exists_among_yield_expressions: { code: 2504, category: DiagnosticCategory.Error, key: "No best common type exists among yield expressions." },
A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: DiagnosticCategory.Error, key: "A generator cannot have a 'void' type annotation." },
A_non_ambient_class_cannot_be_merged_with_an_interface: { code: 2506, category: DiagnosticCategory.Error, key: "A non-ambient class cannot be merged with an interface." },
An_interface_cannot_merge_with_a_non_ambient_class: { code: 2507, category: DiagnosticCategory.Error, key: "An interface cannot merge with a non-ambient class." },
Only_an_ambient_class_can_be_merged_with_an_interface: { code: 2506, category: DiagnosticCategory.Error, key: "Only an ambient class can be merged with an interface." },
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
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}'." },
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },

View File

@@ -1476,14 +1476,10 @@
"category": "Error",
"code": 2505
},
"A non-ambient class cannot be merged with an interface.": {
"Only an ambient class can be merged with an interface.": {
"category": "Error",
"code": 2506
},
"An interface cannot merge with a non-ambient class.": {
"category": "Error",
"code": 2507
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
"code": 4000