test/tools/javac/lambda/8016177/T8016177g.java

Mon, 02 Sep 2013 22:38:36 +0100

author
vromero
date
Mon, 02 Sep 2013 22:38:36 +0100
changeset 2000
4a6acc42c3a1
parent 0
959103a6100f
child 2730
a513711d6171
permissions
-rw-r--r--

8016177: structural most specific and stuckness
Reviewed-by: jjg, vromero
Contributed-by: maurizio.cimadamore@oracle.com

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug 8016081 8016178
     4  * @summary structural most specific and stuckness
     5  * @compile/fail/ref=T8016177g.out -XDrawDiagnostics T8016177g.java
     6  */
     9 class Test {
    11     interface Function<X, Y> {
    12         Y m(X x);
    13     }
    15     interface Box<T> {
    16         T get();
    17         <R> R map(Function<T,R> f);
    18     }
    20     static class Person {
    21         Person(String name) { }
    22     }
    24     void print(Object arg) { }
    25     void print(String arg) { }
    27     int abs(int a) { return 0; }
    28     long abs(long a) { return 0; }
    29     float abs(float a) { return 0; }
    30     double abs(double a) { return 0; }
    32     void test() {
    33         Box<String> b = null;
    34         print(b.map(s -> new Person(s)));
    35         int i = abs(b.map(s -> Double.valueOf(s)));
    36     }
    37 }

mercurial