test/tools/javac/lambda/MethodReference62.java

changeset 0
959103a6100f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/tools/javac/lambda/MethodReference62.java	Wed Apr 27 01:34:52 2016 +0800
     1.3 @@ -0,0 +1,22 @@
     1.4 +/*
     1.5 + * @test /nodynamiccopyright/
     1.6 + * @bug 8007285
     1.7 + * @summary AbstractMethodError instead of compile-time error when method reference with super and abstract
     1.8 + * @compile/fail/ref=MethodReference62.out -XDrawDiagnostics MethodReference62.java
     1.9 + */
    1.10 +class MethodReference62 {
    1.11 +    interface SAM {
    1.12 +        int m();
    1.13 +    }
    1.14 +
    1.15 +    static abstract class Sup {
    1.16 +        abstract int foo() ;
    1.17 +    }
    1.18 +
    1.19 +    static abstract class Sub extends Sup {
    1.20 +        abstract int foo() ;
    1.21 +        void test() {
    1.22 +            SAM s = super::foo;
    1.23 +        }
    1.24 +    }
    1.25 +}

mercurial