1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/Diagnostics/compressed/T8012003b.java Wed May 15 14:00:31 2013 +0100 1.3 @@ -0,0 +1,37 @@ 1.4 +/** 1.5 + * @test /nodynamiccopyright/ 1.6 + * @bug 8012003 1.7 + * @summary Method diagnostics resolution need to be simplified in some cases 1.8 + * test lambda-related overload resolution simplifications 1.9 + * @compile/fail/ref=T8012003b.out -XDrawDiagnostics -Xdiags:compact T8012003b.java 1.10 + */ 1.11 + 1.12 +class T8012003b { 1.13 + 1.14 + interface Consumer_V<X> { 1.15 + void m(X x); 1.16 + } 1.17 + 1.18 + interface Consumer_NV<X> { 1.19 + Integer m(X x); 1.20 + } 1.21 + 1.22 + void m1(Runnable r) { } 1.23 + void m1(Runnable r, String s) { } 1.24 + 1.25 + void m2(Consumer_V<Integer> ci) { } 1.26 + 1.27 + void m3(Consumer_NV<String> ci) { } 1.28 + 1.29 + void g(String arg) { } 1.30 + String g2(String arg) { return arg; } 1.31 + 1.32 + void test() { 1.33 + m1(this::g); 1.34 + m1(()->1); 1.35 + m1(()->false ? "" : ""); 1.36 + m2(this::g); 1.37 + m3(this::g2); 1.38 + m3(this::k); 1.39 + } 1.40 +}