jdk-24/langtools/test/tools/javac/lambda/methodReference/MethodRefIntColonColonNewTest.java

21 lines
535 B
Java
Raw Normal View History

/**
* @test /nodynamiccopyright/
* @bug 8139245
* @summary compiler crashes with exception on int:new method reference and generic method inference
* @compile/fail/ref=MethodRefIntColonColonNewTest.out -XDrawDiagnostics MethodRefIntColonColonNewTest.java
*/
public class MethodRefIntColonColonNewTest {
interface SAM<T> {
T m(T s);
}
static <T> SAM<T> infmethod(SAM<T> t) { return t; }
public static void main(String argv[]) {
SAM<Object> s = infmethod(int::new);
s.m();
}
}