|
1 /* |
|
2 * @test /nodynamiccopyright/ |
|
3 * @bug 8003280 |
|
4 * @summary Add lambda tests |
|
5 * check strict method conversion does not allow loose method reference conversion |
|
6 * @compile/fail/ref=MethodReference26.out -XDrawDiagnostics MethodReference26.java |
|
7 */ |
|
8 |
|
9 class MethodReference26 { |
|
10 |
|
11 static void m(Integer i) { } |
|
12 |
|
13 interface SAM { |
|
14 void m(int x); |
|
15 } |
|
16 |
|
17 static void call(int i, SAM s) { } |
|
18 static void call(Integer i, SAM s) { } |
|
19 |
|
20 static void test() { |
|
21 call(1, MethodReference26::m); //ambiguous |
|
22 } |
|
23 } |