/* * @test /nodynamiccopyright/ * @bug 8030741 * @summary Inference: implement eager resolution of return types, consistent with JDK-8028800 * @compile/fail/ref=PrimitiveTypeBoxingTest.out -XDrawDiagnostics PrimitiveTypeBoxingTest.java */ public class PrimitiveTypeBoxingTest { static void foo(long arg) {} static void bar(int arg) {} interface F { void get(X arg); } void m1(F f, Z arg) {} void m2(Z arg, F f) {} void test() { m1(PrimitiveTypeBoxingTest::foo, 23); // expected: error m2(23, PrimitiveTypeBoxingTest::foo); // expected: error m1(PrimitiveTypeBoxingTest::bar, 23); // expected: success m2(23, PrimitiveTypeBoxingTest::bar); // expected: success } }