Thu, 10 Oct 2013 14:58:04 +0200
8001931: The new build system whitespace cleanup
Reviewed-by: tbell, simonis, erikj
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8003280
4 * @summary Add lambda tests
5 * check that generic method reference is inferred when type parameters are omitted
6 * @compile/fail/ref=MethodReference44.out -XDrawDiagnostics MethodReference44.java
7 */
9 public class MethodReference44 {
11 static class SuperFoo<X> { }
13 static class Foo<X extends Number> extends SuperFoo<X> { }
15 interface SAM1 {
16 SuperFoo<String> m();
17 }
19 interface SAM2 {
20 SuperFoo<Integer> m();
21 }
23 interface SAM3 {
24 SuperFoo<Object> m();
25 }
27 static <X extends Number> Foo<X> m() { return null; }
29 static void g1(SAM1 s) { }
31 static void g2(SAM2 s) { }
33 static void g3(SAM3 s) { }
35 static void g4(SAM1 s) { }
36 static void g4(SAM2 s) { }
37 static void g4(SAM3 s) { }
39 public static void main(String[] args) {
40 g1(MethodReference44::m);
41 g2(MethodReference44::m);
42 g3(MethodReference44::m);
43 g4(MethodReference44::m);
44 }
45 }