test/tools/javac/lambda/MethodReference26.java

changeset 1415
01c9d4161882
child 1510
7873d37f5b37
equal deleted inserted replaced
1414:843d3b191773 1415:01c9d4161882
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 }

mercurial