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:
Andy
2017-11-08 09:40:53 -08:00
committed by GitHub
parent 7a45573311
commit ef6f9351b5
17 changed files with 109 additions and 46 deletions

View File

@@ -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);
}

View File

@@ -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
},