Tue, 10 Sep 2013 13:47:51 +0200
8005222: Fixed bugs should have tests with bugid in @bug tag
Reviewed-by: jfranck, jjg
Contributed-by: Andreas Lundblad <andreas.lundblad@oracle.com>
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * @test /nodynamiccopyright/ |
aoqi@0 | 3 | * @bug 8016081 8016178 |
aoqi@0 | 4 | * @summary structural most specific and stuckness |
aoqi@0 | 5 | * @compile/fail/ref=T8016177g.out -XDrawDiagnostics T8016177g.java |
aoqi@0 | 6 | */ |
aoqi@0 | 7 | |
aoqi@0 | 8 | |
aoqi@0 | 9 | class Test { |
aoqi@0 | 10 | |
aoqi@0 | 11 | interface Function<X, Y> { |
aoqi@0 | 12 | Y m(X x); |
aoqi@0 | 13 | } |
aoqi@0 | 14 | |
aoqi@0 | 15 | interface Box<T> { |
aoqi@0 | 16 | T get(); |
aoqi@0 | 17 | <R> R map(Function<T,R> f); |
aoqi@0 | 18 | } |
aoqi@0 | 19 | |
aoqi@0 | 20 | static class Person { |
aoqi@0 | 21 | Person(String name) { } |
aoqi@0 | 22 | } |
aoqi@0 | 23 | |
aoqi@0 | 24 | void print(Object arg) { } |
aoqi@0 | 25 | void print(String arg) { } |
aoqi@0 | 26 | |
aoqi@0 | 27 | int abs(int a) { return 0; } |
aoqi@0 | 28 | long abs(long a) { return 0; } |
aoqi@0 | 29 | float abs(float a) { return 0; } |
aoqi@0 | 30 | double abs(double a) { return 0; } |
aoqi@0 | 31 | |
aoqi@0 | 32 | void test() { |
aoqi@0 | 33 | Box<String> b = null; |
aoqi@0 | 34 | print(b.map(s -> new Person(s))); |
aoqi@0 | 35 | int i = abs(b.map(s -> Double.valueOf(s))); |
aoqi@0 | 36 | } |
aoqi@0 | 37 | } |