MethodRefIntColonColonNewTest.java revision 3054:700677b16a97
1/**
2 * @test    /nodynamiccopyright/
3 * @bug     8139245
4 * @summary compiler crashes with exception on int:new method reference and generic method inference
5 * @compile/fail/ref=MethodRefIntColonColonNewTest.out -XDrawDiagnostics MethodRefIntColonColonNewTest.java
6 */
7
8public class MethodRefIntColonColonNewTest {
9
10    interface SAM<T> {
11        T m(T s);
12    }
13
14    static <T> SAM<T> infmethod(SAM<T> t) { return t; }
15
16    public static void main(String argv[]) {
17        SAM<Object> s = infmethod(int::new);
18        s.m();
19    }
20}
21