@@ -7244,8 +7244,7 @@ namespace ts {
7244
7244
let declaringClass = <InterfaceType>getDeclaredTypeOfSymbol(prop.parent);;
7245
7245
7246
7246
if (left.kind === SyntaxKind.SuperKeyword) {
7247
- let errorNode = (<PropertyAccessExpression>node).name ?
7248
- (<PropertyAccessExpression>node).name :
7247
+ let errorNode = node.kind === SyntaxKind.PropertyAccessExpression ? (<PropertyAccessExpression>node).name :
7249
7248
(<QualifiedName>node).right;
7250
7249
7251
7250
// TS 1.0 spec (April 2014): 4.8.2
@@ -9978,6 +9977,12 @@ namespace ts {
9978
9977
9979
9978
// Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration
9980
9979
checkFunctionLikeDeclaration(node);
9980
+
9981
+ // Abstract methods cannot have an implementation.
9982
+ // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node.
9983
+ if(node.flags & NodeFlags.Abstract && node.body) {
9984
+ error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
9985
+ }
9981
9986
}
9982
9987
9983
9988
function checkConstructorDeclaration(node: ConstructorDeclaration) {
@@ -10381,12 +10386,6 @@ namespace ts {
10381
10386
if (!bodyDeclaration) {
10382
10387
bodyDeclaration = node;
10383
10388
}
10384
-
10385
- // abstract functions cannot have an implementation.
10386
- // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node.
10387
- if (currentNodeFlags & NodeFlags.Abstract && node.kind === SyntaxKind.MethodDeclaration && !isConstructor) {
10388
- error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name))
10389
- }
10390
10389
}
10391
10390
else {
10392
10391
hasOverloads = true;
@@ -14251,8 +14250,9 @@ namespace ts {
14251
14250
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_element, text);
14252
14251
}
14253
14252
else if (flags & NodeFlags.Abstract) {
14254
- if (modifier.kind === SyntaxKind.PrivateKeyword) {
14255
- return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract")}
14253
+ if (modifier.kind === SyntaxKind.PrivateKeyword) {
14254
+ return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract");
14255
+ }
14256
14256
else {
14257
14257
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract");
14258
14258
}
0 commit comments