jdk-24/test/langtools/tools/javac/lambda/MethodReference55.java
2017-09-12 19:03:39 +02:00

23 lines
461 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8004101 8072445
* @summary Add checks for method reference well-formedness
* @compile/fail/ref=MethodReference55.out -XDrawDiagnostics MethodReference55.java
*/
class MethodReference55<X> {
interface V {
void m(Object o);
}
V v = new MethodReference55<String>()::m;
void test() {
g(new MethodReference55<String>()::m);
}
void g(V v) { }
static void m(Object o) { };
}