test/tools/javac/lambda/MethodReference39.java

changeset 0
959103a6100f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/tools/javac/lambda/MethodReference39.java	Wed Apr 27 01:34:52 2016 +0800
     1.3 @@ -0,0 +1,25 @@
     1.4 +/*
     1.5 + * @test /nodynamiccopyright/
     1.6 + * @bug 8003280
     1.7 + * @summary Add lambda tests
     1.8 + *  check that bad enclosing class parameter type is discarded accordingly
     1.9 + * @compile/fail/ref=MethodReference39.out -XDrawDiagnostics MethodReference39.java
    1.10 + */
    1.11 +class MethodReference39 {
    1.12 +
    1.13 +    static class Sup {}
    1.14 +
    1.15 +
    1.16 +    static class Sub extends Sup {
    1.17 +
    1.18 +        interface SAM { Sup m(Sup x, String str); }
    1.19 +
    1.20 +        class Inner extends Sup {
    1.21 +            Inner(String val) { }
    1.22 +        }
    1.23 +
    1.24 +        void test() {
    1.25 +            SAM var = Sub.Inner::new;;
    1.26 +        }
    1.27 +    }
    1.28 +}

mercurial