test/tools/javac/lambda/MethodReference32.java

Thu, 06 Jun 2013 15:33:40 +0100

author
mcimadamore
date
Thu, 06 Jun 2013 15:33:40 +0100
changeset 1811
349160289ba2
parent 0
959103a6100f
permissions
-rw-r--r--

8008627: Compiler mishandles three-way return-type-substitutability
Summary: Compiler should not enforce an order in how ambiguous methods should be resolved
Reviewed-by: jjg, vromero

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug 8003280
     4  * @summary Add lambda tests
     5  *  check that varargs warnings are generated during SAM conversion
     6  * @compile/fail/ref=MethodReference32.out -Xlint:unchecked -Werror -XDrawDiagnostics MethodReference32.java
     7  */
     9 import java.util.*;
    11 class MethodReference32 {
    13     interface SAM {
    14         MethodReference32 m(List<Integer> l1, List<Integer> l2);
    15     }
    17     MethodReference32 meth(List<Integer>... lli) { return null; }
    18     MethodReference32(List<Integer>... lli) { }
    20     SAM s1 = this::meth;
    21     SAM s2 = MethodReference32::new;
    22 }

mercurial