Skip to content

Commit 29c9286

Browse files
author
Arthur Ozga
committed
Updated error message
1 parent 2b899f1 commit 29c9286

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10417,7 +10417,7 @@ module ts {
1041710417

1041810418
// Non-ambient classes cannot merge with interfaces.
1041910419
if (!(node.flags & NodeFlags.Ambient) && symbol.flags & SymbolFlags.Interface) {
10420-
error(node, Diagnostics.A_non_ambient_class_cannot_be_merged_with_an_interface)
10420+
error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface)
1042110421
}
1042210422

1042310423
forEach(node.members, checkSourceElement);
@@ -10600,10 +10600,11 @@ module ts {
1060010600
}
1060110601
}
1060210602

10603+
// Interfaces cannot merge with non-ambient classes.
1060310604
if (symbol && symbol.declarations) {
1060410605
for (let declaration of symbol.declarations) {
1060510606
if (declaration.kind === SyntaxKind.ClassDeclaration && !(declaration.flags & NodeFlags.Ambient)) {
10606-
error(node, Diagnostics.An_interface_cannot_merge_with_a_non_ambient_class);
10607+
error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
1060710608
break;
1060810609
}
1060910610
}

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,7 @@ module ts {
372372
Cannot_find_namespace_0: { code: 2503, category: DiagnosticCategory.Error, key: "Cannot find namespace '{0}'." },
373373
No_best_common_type_exists_among_yield_expressions: { code: 2504, category: DiagnosticCategory.Error, key: "No best common type exists among yield expressions." },
374374
A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: DiagnosticCategory.Error, key: "A generator cannot have a 'void' type annotation." },
375-
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." },
376-
An_interface_cannot_merge_with_a_non_ambient_class: { code: 2507, category: DiagnosticCategory.Error, key: "An interface cannot merge with a non-ambient class." },
375+
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." },
377376
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
378377
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}'." },
379378
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}'." },

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,14 +1476,10 @@
14761476
"category": "Error",
14771477
"code": 2505
14781478
},
1479-
"A non-ambient class cannot be merged with an interface.": {
1479+
"Only an ambient class can be merged with an interface.": {
14801480
"category": "Error",
14811481
"code": 2506
14821482
},
1483-
"An interface cannot merge with a non-ambient class.": {
1484-
"category": "Error",
1485-
"code": 2507
1486-
},
14871483
"Import declaration '{0}' is using private name '{1}'.": {
14881484
"category": "Error",
14891485
"code": 4000

0 commit comments

Comments
 (0)