|
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 } |