|
1 /** |
|
2 * @test /nodynamiccopyright/ |
|
3 * @bug 8012003 |
|
4 * @summary Method diagnostics resolution need to be simplified in some cases |
|
5 * test lambda-related overload resolution simplifications |
|
6 * @compile/fail/ref=T8012003b.out -XDrawDiagnostics -Xdiags:compact T8012003b.java |
|
7 */ |
|
8 |
|
9 class T8012003b { |
|
10 |
|
11 interface Consumer_V<X> { |
|
12 void m(X x); |
|
13 } |
|
14 |
|
15 interface Consumer_NV<X> { |
|
16 Integer m(X x); |
|
17 } |
|
18 |
|
19 void m1(Runnable r) { } |
|
20 void m1(Runnable r, String s) { } |
|
21 |
|
22 void m2(Consumer_V<Integer> ci) { } |
|
23 |
|
24 void m3(Consumer_NV<String> ci) { } |
|
25 |
|
26 void g(String arg) { } |
|
27 String g2(String arg) { return arg; } |
|
28 |
|
29 void test() { |
|
30 m1(this::g); |
|
31 m1(()->1); |
|
32 m1(()->false ? "" : ""); |
|
33 m2(this::g); |
|
34 m3(this::g2); |
|
35 m3(this::k); |
|
36 } |
|
37 } |