Sat, 22 Dec 2018 13:10:38 -0800
Added tag jdk8u202-b25 for changeset 15d8c732039b
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=MethodReference41.out -XDrawDiagnostics MethodReference41.java
7 */
9 public class MethodReference41 {
11 interface SAM1 {
12 void m(String s);
13 }
15 interface SAM2 {
16 void m(Integer s);
17 }
19 interface SAM3 {
20 void m(Object o);
21 }
23 static class Foo<X extends Number> {
24 Foo(X x) { }
25 }
27 static void m1(SAM1 s) { }
29 static void m2(SAM2 s) { }
31 static void m3(SAM3 s) { }
33 static void m4(SAM1 s) { }
34 static void m4(SAM2 s) { }
35 static void m4(SAM3 s) { }
37 public static void main(String[] args) {
38 m1(Foo::new);
39 m2(Foo::new);
40 m3(Foo::new);
41 m4(Foo::new);
42 }
43 }