mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
new inference: overload resolution: check return types when method refs are exact
(cherry picked from commit ccacf897e97a121f795a079e485249842c95c273)
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
class Test {
|
||||
|
||||
interface A<X> {
|
||||
X m();
|
||||
}
|
||||
interface B<X> extends A<X> {}
|
||||
interface C<X> {}
|
||||
|
||||
int integerRes() { return new Integer(42); }
|
||||
|
||||
int intRes() { return 42; }
|
||||
|
||||
void m(A<Integer> a) {}
|
||||
void m(B<String> b) {}
|
||||
void m(C<CharSequence> b) {}
|
||||
|
||||
void test(boolean flag) {
|
||||
m(this::integerRes);
|
||||
m(flag ? this::integerRes : this::integerRes);
|
||||
|
||||
m(this::intRes);
|
||||
m(flag ? this::intRes : this::intRes);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user