jdk-24/langtools/test/tools/javac/lambda/MethodReference26.java
Maurizio Cimadamore a494f0ab86 8003280: Add lambda tests
Turn on lambda expression, method reference and default method support

Reviewed-by: jjg
2012-11-17 19:01:03 +00:00

24 lines
533 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8003280
* @summary Add lambda tests
* check strict method conversion does not allow loose method reference conversion
* @compile/fail/ref=MethodReference26.out -XDrawDiagnostics MethodReference26.java
*/
class MethodReference26 {
static void m(Integer i) { }
interface SAM {
void m(int x);
}
static void call(int i, SAM s) { }
static void call(Integer i, SAM s) { }
static void test() {
call(1, MethodReference26::m); //ambiguous
}
}