test/tools/javac/lambda/MethodReference26.java

Tue, 08 Jan 2013 13:47:57 +0000

author
vromero
date
Tue, 08 Jan 2013 13:47:57 +0000
changeset 1482
954541f13717
parent 1415
01c9d4161882
child 1510
7873d37f5b37
permissions
-rw-r--r--

8005167: execution time of combo tests in javac should be improved
Reviewed-by: jjg, jjh

     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