mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Merge pull request #28015 from prateekgoel/error-messages
Error messages for extending a specific type
This commit is contained in:
@@ -5894,7 +5894,7 @@ namespace ts {
|
||||
return type.resolvedBaseTypes = emptyArray;
|
||||
}
|
||||
if (!isValidBaseType(baseType)) {
|
||||
error(baseTypeNode.expression, Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType));
|
||||
error(baseTypeNode.expression, Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(baseType));
|
||||
return type.resolvedBaseTypes = emptyArray;
|
||||
}
|
||||
if (type === baseType || hasBaseType(baseType, type)) {
|
||||
@@ -5952,7 +5952,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
else {
|
||||
error(node, Diagnostics.An_interface_may_only_extend_a_class_or_another_interface);
|
||||
error(node, Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26454,7 +26454,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
else {
|
||||
error(typeRefNode, Diagnostics.A_class_may_only_implement_another_class_or_interface);
|
||||
error(typeRefNode, Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1060,7 +1060,7 @@
|
||||
"category": "Error",
|
||||
"code": 2311
|
||||
},
|
||||
"An interface may only extend a class or another interface.": {
|
||||
"An interface can only extend an object type or intersection of object types with statically known members.": {
|
||||
"category": "Error",
|
||||
"code": 2312
|
||||
},
|
||||
@@ -1488,7 +1488,7 @@
|
||||
"category": "Error",
|
||||
"code": 2420
|
||||
},
|
||||
"A class may only implement another class or interface.": {
|
||||
"A class can only implement an object type or intersection of object types with statically known members.": {
|
||||
"category": "Error",
|
||||
"code": 2422
|
||||
},
|
||||
@@ -1820,7 +1820,7 @@
|
||||
"category": "Error",
|
||||
"code": 2508
|
||||
},
|
||||
"Base constructor return type '{0}' is not a class or interface type.": {
|
||||
"Base constructor return type '{0}' is not an object type or intersection of object types with statically known members.": {
|
||||
"category": "Error",
|
||||
"code": 2509
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user