mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] fix expection on super reference in trait without supertypes (EA-74829)
This commit is contained in:
+3
-1
@@ -262,7 +262,9 @@ public class GrReferenceExpressionImpl extends GrReferenceElementImpl<GrExpressi
|
||||
|
||||
PsiClassType[] superTypes = ArrayUtil.mergeArrays(implementsTypes, extendsTypes, PsiClassType.ARRAY_FACTORY);
|
||||
|
||||
return PsiIntersectionType.createIntersection(ArrayUtil.reverseArray(superTypes));
|
||||
if (superTypes.length > 0) {
|
||||
return PsiIntersectionType.createIntersection(ArrayUtil.reverseArray(superTypes));
|
||||
}
|
||||
}
|
||||
return factory.createType((PsiClass)resolved);
|
||||
}
|
||||
|
||||
+10
@@ -475,4 +475,14 @@ class A implements T {}
|
||||
new A().foo
|
||||
''', GroovyUnusedDeclarationInspection
|
||||
}
|
||||
|
||||
void 'test no exception on super reference in trait without supertypes'() {
|
||||
testHighlighting '''\
|
||||
trait SimpleTrait {
|
||||
void foo() {
|
||||
super.<warning descr="Cannot resolve symbol 'foo'">foo</warning>()
|
||||
}
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user