mcimadamore@1415: /* vromero@2015: * @test /nodynamiccopyright/ mcimadamore@1415: * @bug 8003280 mcimadamore@1415: * @summary Add lambda tests mcimadamore@1415: * check that generic method reference is inferred when type parameters are omitted vromero@2000: * @compile/fail/ref=MethodReference44.out -XDrawDiagnostics MethodReference44.java mcimadamore@1415: */ vromero@2015: mcimadamore@1415: public class MethodReference44 { mcimadamore@1415: mcimadamore@1415: static class SuperFoo { } mcimadamore@1415: mcimadamore@1415: static class Foo extends SuperFoo { } mcimadamore@1415: mcimadamore@1415: interface SAM1 { mcimadamore@1415: SuperFoo m(); mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: interface SAM2 { mcimadamore@1415: SuperFoo m(); mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: interface SAM3 { mcimadamore@1415: SuperFoo m(); mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: static Foo m() { return null; } mcimadamore@1415: vromero@2000: static void g1(SAM1 s) { } vromero@2000: vromero@2000: static void g2(SAM2 s) { } vromero@2000: vromero@2000: static void g3(SAM3 s) { } vromero@2000: vromero@2000: static void g4(SAM1 s) { } vromero@2000: static void g4(SAM2 s) { } vromero@2000: static void g4(SAM3 s) { } mcimadamore@1415: mcimadamore@1415: public static void main(String[] args) { vromero@2000: g1(MethodReference44::m); vromero@2000: g2(MethodReference44::m); vromero@2000: g3(MethodReference44::m); vromero@2000: g4(MethodReference44::m); mcimadamore@1415: } mcimadamore@1415: }