diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6a45dacb32a..b0b6521e230 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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; } } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 358dea6e988..e327a516311 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -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}'." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 8f3973fbdb8..871fb2d9ea8 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -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