mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 15:50:52 +07:00
inference: ensure foreign variables do not participate in inference process, e.g. variables from method reference overload resolution (IDEA-154622)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
class SomeClass<K, V> {
|
||||
|
||||
SomeClass(Function<K, V> transformer) {}
|
||||
|
||||
static <M, N> SomeClass<M, N> create(Function<M, N> t) {
|
||||
return null;
|
||||
}
|
||||
|
||||
static void someMethod() {
|
||||
final SomeClass<MyBean, String> instance = create(MyBean::overloadedMethod);
|
||||
final SomeClass<MyBean, String> instance1 = new SomeClass<>(MyBean::overloadedMethod);
|
||||
}
|
||||
}
|
||||
class MyBean {
|
||||
|
||||
private String overloadedMethod(String param) {
|
||||
return param;
|
||||
}
|
||||
|
||||
public String overloadedMethod() {
|
||||
return overloadedMethod(null);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user