jdk-24/test/langtools/tools/javac/lambda/methodReference/MethodRefIntColonColonNewTest.java
2023-01-17 04:43:40 +00:00

21 lines
522 B
Java

/**
* @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 meth() {
SAM<Object> s = infmethod(int::new);
s.m();
}
}