1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/lambda/MethodReference71.java Wed Jul 17 14:09:46 2013 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +/* 1.5 + * @test /nodynamiccopyright/ 1.6 + * @bug 8016175 1.7 + * @summary Add bottom-up type-checking support for unambiguous method references 1.8 + * @compile/fail/ref=MethodReference71.out -XDrawDiagnostics MethodReference71.java 1.9 + */ 1.10 +class MethodReference71 { 1.11 + interface F<X> { 1.12 + void m(X x); 1.13 + } 1.14 + 1.15 + interface G<X> { 1.16 + Integer m(X x); 1.17 + } 1.18 + 1.19 + void m1(Integer i) { } 1.20 + void m2(Integer... i) { } 1.21 + 1.22 + <Z> void g(F<Z> f) { } 1.23 + <Z> void g(G<Z> g) { } 1.24 + 1.25 + void test() { 1.26 + g(this::m1); //ok 1.27 + g(this::m2); //ambiguous (stuck!) 1.28 + } 1.29 +}