mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
Fix undefined error for diagnostic for instantiating an abstract class (#19809)
* Fix undefined error for diagnostic for instantiating an abstract class * Only use the name-less diagnostic
This commit is contained in:
@@ -16726,7 +16726,7 @@ namespace ts {
|
||||
// only the class declaration node will have the Abstract flag set.
|
||||
const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol);
|
||||
if (valueDecl && hasModifier(valueDecl, ModifierFlags.Abstract)) {
|
||||
error(node, Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, declarationNameToString(getNameOfDeclaration(valueDecl)));
|
||||
error(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
||||
return resolveErrorCall(node);
|
||||
}
|
||||
|
||||
|
||||
@@ -1716,7 +1716,7 @@
|
||||
"category": "Error",
|
||||
"code": 2510
|
||||
},
|
||||
"Cannot create an instance of the abstract class '{0}'.": {
|
||||
"Cannot create an instance of an abstract class.": {
|
||||
"category": "Error",
|
||||
"code": 2511
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user