From 72bd22ffd75e42ff9c9454e44ace22b729fe658a Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Wed, 14 Nov 2012 19:23:48 +0400 Subject: [PATCH] IDEA-94938 Invalid error reported on Type param --- .../groovy/annotator/GroovyAnnotator.java | 2 +- .../highlighting/GroovyHighlightingTest.groovy | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java index 9bbb99656726..66e4a8b30e2e 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java @@ -336,7 +336,7 @@ public class GroovyAnnotator extends GroovyElementVisitor implements Annotator { } private static void checkConstructors(AnnotationHolder holder, GrTypeDefinition typeDefinition) { - if (typeDefinition.isEnum() || typeDefinition.isInterface() || typeDefinition.isAnonymous()) return; + if (typeDefinition.isEnum() || typeDefinition.isInterface() || typeDefinition.isAnonymous() || typeDefinition instanceof GrTypeParameter) return; final PsiClass superClass = typeDefinition.getSuperClass(); if (superClass == null) return; diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GroovyHighlightingTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GroovyHighlightingTest.groovy index fd8ce92b19e9..80c544755e29 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GroovyHighlightingTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GroovyHighlightingTest.groovy @@ -927,4 +927,22 @@ class A { assertNotNull(myFixture.findSingleIntention("Create Method 'abc'")) } + + void testTypeParameterIsCorrect() { + testHighlighting('''\ +class Component{} + +class Window extends Component{ + Window(i) { + } +} + +class Super { + +} + +class Sub extends Super { +} +''') + } } \ No newline at end of file