[groovy] fix expection on super reference in trait without supertypes (EA-74829)

This commit is contained in:
Daniil Ovchinnikov
2016-12-14 20:02:37 +03:00
parent d29c4fa1a7
commit 632fee20aa
2 changed files with 13 additions and 1 deletions
@@ -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);
}
@@ -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>()
}
}
'''
}
}