Skip to content

Commit d45eed3

Browse files
committed
Error messages for extending a specific type
1 parent 72244c5 commit d45eed3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5831,7 +5831,7 @@ namespace ts {
58315831
}
58325832
}
58335833
else {
5834-
error(node, Diagnostics.An_interface_may_only_extend_a_class_or_another_interface);
5834+
error(node, Diagnostics.An_interface_can_only_extend_an_object_or_intersection_type_with_statically_known_members);
58355835
}
58365836
}
58375837
}
@@ -25979,7 +25979,7 @@ namespace ts {
2597925979
}
2598025980
}
2598125981
else {
25982-
error(typeRefNode, Diagnostics.A_class_may_only_implement_another_class_or_interface);
25982+
error(typeRefNode, Diagnostics.A_class_can_only_implement_an_object_or_intersection_type_with_statically_known_members);
2598325983
}
2598425984
}
2598525985
}

src/compiler/diagnosticMessages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@
10561056
"category": "Error",
10571057
"code": 2311
10581058
},
1059-
"An interface may only extend a class or another interface.": {
1059+
"An interface can only extend an object or intersection type with statically known members.": {
10601060
"category": "Error",
10611061
"code": 2312
10621062
},
@@ -1484,7 +1484,7 @@
14841484
"category": "Error",
14851485
"code": 2420
14861486
},
1487-
"A class may only implement another class or interface.": {
1487+
"A class can only implement an object or intersection type with statically known members.": {
14881488
"category": "Error",
14891489
"code": 2422
14901490
},

0 commit comments

Comments
 (0)