test/tools/javac/lambda/MethodReference26.java

Sat, 17 Nov 2012 19:01:03 +0000

author
mcimadamore
date
Sat, 17 Nov 2012 19:01:03 +0000
changeset 1415
01c9d4161882
child 1510
7873d37f5b37
permissions
-rw-r--r--

8003280: Add lambda tests
Summary: Turn on lambda expression, method reference and default method support
Reviewed-by: jjg

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug 8003280
     4  * @summary Add lambda tests
     5  *  check strict method conversion does not allow loose method reference conversion
     6  * @compile/fail/ref=MethodReference26.out -XDrawDiagnostics MethodReference26.java
     7  */
     9 class MethodReference26 {
    11     static void m(Integer i) { }
    13     interface SAM {
    14         void m(int x);
    15     }
    17     static void call(int i, SAM s) {   }
    18     static void call(Integer i, SAM s) {   }
    20     static void test() {
    21         call(1, MethodReference26::m); //ambiguous
    22     }
    23 }

mercurial