IDEA-93355 Incorrect 'inner class cannot have static declarations'

This commit is contained in:
Max Medvedev
2012-10-26 10:36:43 +04:00
parent aa3017857d
commit 2c5b0d8d50
2 changed files with 1 additions and 4 deletions
@@ -1548,9 +1548,6 @@ public class GroovyAnnotator extends GroovyElementVisitor implements Annotator {
checkModifierIsNotAllowed(modifiersList, PROTECTED, GroovyBundle.message("interface.members.are.not.allowed.to.be", PROTECTED), holder);
}
else if (containingTypeDef.isAnonymous()) {
//anonymous class
checkModifierIsNotAllowed(modifiersList, STATIC, GroovyBundle.message("static.declaration.in.inner.class"), holder);
if (isMethodAbstract) {
final Annotation annotation = holder.createErrorAnnotation(getModifierOrList(modifiersList, ABSTRACT), GroovyBundle.message("anonymous.class.cannot.have.abstract.method"));
registerMakeAbstractMethodNotAbstractFix(annotation, method, false);
@@ -79,7 +79,7 @@ public class GroovyHighlightingTest extends GrHighlightingTestBase {
public void testAnonymousClassConstructor() {doTest();}
public void testAnonymousClassAbstractMethod() {doTest();}
public void testAnonymousClassStaticMethod() {doTest();}
public void _testAnonymousClassStaticMethod() {doTest();}
public void testAnonymousClassShoudImplementMethods() {doTest();}
public void testAnonymousClassShouldImplementSubstitutedMethod() {doTest();}