@@ -16128,16 +16128,6 @@ namespace ts {
1612816128 return resolveErrorCall(node);
1612916129 }
1613016130
16131- // If the expression is a class of abstract type, then it cannot be instantiated.
16132- // Note, only class declarations can be declared abstract.
16133- // In the case of a merged class-module or class-interface declaration,
16134- // only the class declaration node will have the Abstract flag set.
16135- const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol);
16136- if (valueDecl && hasModifier(valueDecl, ModifierFlags.Abstract)) {
16137- error(node, Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, declarationNameToString(getNameOfDeclaration(valueDecl)));
16138- return resolveErrorCall(node);
16139- }
16140-
1614116131 // TS 1.0 spec: 4.11
1614216132 // If expressionType is of type Any, Args can be any argument
1614316133 // list and the result of the operation is of type Any.
@@ -16157,6 +16147,16 @@ namespace ts {
1615716147 if (!isConstructorAccessible(node, constructSignatures[0])) {
1615816148 return resolveErrorCall(node);
1615916149 }
16150+ // If the expression is a class of abstract type, then it cannot be instantiated.
16151+ // Note, only class declarations can be declared abstract.
16152+ // In the case of a merged class-module or class-interface declaration,
16153+ // only the class declaration node will have the Abstract flag set.
16154+ const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol);
16155+ if (valueDecl && hasModifier(valueDecl, ModifierFlags.Abstract)) {
16156+ error(node, Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, declarationNameToString(getNameOfDeclaration(valueDecl)));
16157+ return resolveErrorCall(node);
16158+ }
16159+
1616016160 return resolveCall(node, constructSignatures, candidatesOutArray);
1616116161 }
1616216162
0 commit comments