IDEA-217978 Failure of resolving DGM methods on bounded type parameters

GitOrigin-RevId: badb61f5dfbbc8b4100ce9b50e0ba6fcb21d270b
This commit is contained in:
Konstantin.Nisht
2019-07-11 18:09:28 +03:00
committed by intellij-monorepo-bot
parent 226dc36006
commit 535f06f5cd
2 changed files with 13 additions and 2 deletions
@@ -262,8 +262,10 @@ public class ResolveUtil {
private static void collectSuperTypes(PsiType type, Set<? super String> visited, Project project) {
String qName = rawCanonicalText(type);
if (!visited.add(qName)) {
return;
if (!(type instanceof PsiClassType && ((PsiClassType)type).resolve() instanceof PsiTypeParameter)) {
if (!visited.add(qName)) {
return;
}
}
final PsiType[] superTypes = type.getSuperTypes();
@@ -2376,4 +2376,13 @@ def foo(Object[] o) {}
''', GrMethod
assert method.parameterList.parameters.first().type.equalsToText('java.util.List')
}
void 'test IDEA-217978'() {
def method = resolveByText '''\
def <T extends List<Integer>> void foo(T a) {
a.eve<caret>ry {true}
}
''', GrGdkMethod
assert method.staticMethod.name == "every"
}
}