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 diamond inference is applied when using raw constructor reference qualifier
6 * @compile/fail/ref=MethodReference43.out -XDrawDiagnostics MethodReference43.java
7 */
9 public class MethodReference43 {
11 interface SAM1 {
12 Foo<?> m(String s);
13 }
15 interface SAM2 {
16 Foo<?> m(Integer s);
17 }
19 interface SAM3 {
20 Foo<?> m(Object o);
21 }
23 interface SAM4 {
24 Foo<Number> m(Integer o);
25 }
27 static class Foo<X extends Number> {
28 Foo(X x) { }
29 }
31 static void m1(SAM1 s) { }
33 static void m2(SAM2 s) { }
35 static void m3(SAM3 s) { }
37 static void m4(SAM4 s) { }
39 static void m5(SAM1 s) { }
40 static void m5(SAM2 s) { }
41 static void m5(SAM3 s) { }
42 static void m5(SAM4 s) { }
44 public static void main(String[] args) {
45 m1(Foo::new);
46 m2(Foo::new);
47 m3(Foo::new);
48 m4(Foo::new);
49 m5(Foo::new);
50 }
51 }