mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
method refs: choose more specific return type when checking more specific functional interface
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
class MyTest {
|
||||
|
||||
static class Foo<T> {
|
||||
T m() { return null; };
|
||||
}
|
||||
|
||||
interface I1 {
|
||||
Foo<Object> m(Foo<String> f);
|
||||
}
|
||||
|
||||
interface I2 {
|
||||
Integer m(Foo<Integer> f);
|
||||
}
|
||||
|
||||
interface I3 {
|
||||
Object m(Foo<Integer> f);
|
||||
}
|
||||
|
||||
static void foo(I1 i) {}
|
||||
static void foo(I2 i) {}
|
||||
static void foo(I3 i) {}
|
||||
|
||||
static {
|
||||
foo(Foo::m);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user