/* * @test /nodynamiccopyright/ * @bug 8004102 * @summary Add support for array constructor references * @compile/fail/ref=MethodReference60.out -XDrawDiagnostics MethodReference60.java */ public class MethodReference60 { interface ArrayFactory { X make(int size); } interface BadArrayFactory1 { X make(); } interface BadArrayFactory2 { X make(int i1, int i2); } interface BadArrayFactory3 { X make(String s); } public static void meth() { BadArrayFactory1 factory1 = int[]::new; //param mismatch BadArrayFactory2 factory2 = int[]::new; //param mismatch BadArrayFactory3 factory3 = int[]::new; //param mismatch ArrayFactory factory4 = int[]::new; //return type mismatch ArrayFactory factory5 = int[]::new; //return type mismatch } }