method references overload resolution: skip static methods of interfaces called on inheritor (IDEA-209920)

GitOrigin-RevId: 9e7889def32913679fa867f9dd2a80f8d187964e
This commit is contained in:
Anna Kozlova
2019-04-26 15:34:02 +02:00
committed by intellij-monorepo-bot
parent d3928de54b
commit 7a03a2be5c
3 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import java.util.function.Function;
class Main {
void m(B b) {
Function<A<String>, String> f1 = A<String>::getName;
Function<A<String>, String> f10 = A::getName;
Function<B, String> f2 = B::getName;
Function<B, String> f3 = b::<error descr="Cannot resolve method 'getName'">getName</error>;
}
}
interface I {
String getName();
static String getName(final I i) {
return null;
}
}
class A<T> implements I {
@Override
public String getName() {
return null;
}
}
class B implements I {
@Override
public String getName() {
return null;
}
}