test/tools/javac/lambda/MethodReference47.java

changeset 0
959103a6100f
child 2525
2eb010b6cb22
equal deleted inserted replaced
-1:000000000000 0:959103a6100f
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=MethodReference47.out -XDrawDiagnostics MethodReference47.java
7 */
8 public class MethodReference47 {
9
10 interface SAM1 {
11 void m(Integer s);
12 }
13
14 interface SAM2 {
15 void m(Integer s);
16 }
17
18 static class Foo<X extends Number> {
19 Foo(X x) { }
20 }
21
22 static <X extends Number> void m(X fx) { }
23
24 static void g1(SAM1 s) { }
25 static void g2(SAM1 s) { }
26 static void g2(SAM2 s) { }
27
28 public static void main(String[] args) {
29 g1(MethodReference47::m);
30 g2(MethodReference47::m);
31 }
32 }

mercurial