Wed, 15 May 2013 14:00:31 +0100
8012003: Method diagnostics resolution need to be simplified in some cases
Summary: Unfold method resolution diagnostics when they mention errors in poly expressions
Reviewed-by: jjg, vromero
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 */
9 class T8012003b {
11 interface Consumer_V<X> {
12 void m(X x);
13 }
15 interface Consumer_NV<X> {
16 Integer m(X x);
17 }
19 void m1(Runnable r) { }
20 void m1(Runnable r, String s) { }
22 void m2(Consumer_V<Integer> ci) { }
24 void m3(Consumer_NV<String> ci) { }
26 void g(String arg) { }
27 String g2(String arg) { return arg; }
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 }