aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 8016175 aoqi@0: * @summary Add bottom-up type-checking support for unambiguous method references aoqi@0: * @compile/fail/ref=MethodReference68.out -XDrawDiagnostics MethodReference68.java aoqi@0: */ aoqi@0: class MethodReference68 { aoqi@0: interface F { aoqi@0: String m(X x); aoqi@0: } aoqi@0: aoqi@0: static class Foo { aoqi@0: String getName() { return ""; } aoqi@0: } aoqi@0: aoqi@0: @SuppressWarnings("unchecked") aoqi@0: void g(F fz, Z... zs) { } aoqi@0: aoqi@0: void test() { aoqi@0: g(Foo::getName); aoqi@0: g(Foo::getName, 1); //incompatible constraints, Z <: Foo, Z :> Integer aoqi@0: } aoqi@0: }