test/tools/javac/lambda/MethodReference08.java

changeset 0
959103a6100f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/tools/javac/lambda/MethodReference08.java	Wed Apr 27 01:34:52 2016 +0800
     1.3 @@ -0,0 +1,24 @@
     1.4 +/*
     1.5 + * @test /nodynamiccopyright/
     1.6 + * @bug 8003280
     1.7 + * @summary Add lambda tests
     1.8 + *  check that syntax for selecting generic receiver works
     1.9 + * @author  Maurizio Cimadamore
    1.10 + *
    1.11 + * @compile MethodReference08.java
    1.12 + * @compile/fail/ref=MethodReference08.out -Werror -Xlint:rawtypes -XDrawDiagnostics MethodReference08.java
    1.13 + */
    1.14 +
    1.15 +class MethodReference08 {
    1.16 +    interface SAM {
    1.17 +       String m(Foo f);
    1.18 +    }
    1.19 +
    1.20 +    static class Foo<X> {
    1.21 +       String getX() { return null; }
    1.22 +
    1.23 +       static void test() {
    1.24 +          SAM s = Foo::getX;
    1.25 +       }
    1.26 +    }
    1.27 +}

mercurial