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 8016177 8016178 |
aoqi@0 | 4 | * @summary structural most specific and stuckness |
aoqi@0 | 5 | * @compile/fail/ref=T8016177a.out -XDrawDiagnostics T8016177a.java |
aoqi@0 | 6 | */ |
aoqi@0 | 7 | import java.util.List; |
aoqi@0 | 8 | |
aoqi@0 | 9 | class T8016177a { |
aoqi@0 | 10 | |
aoqi@0 | 11 | interface ToIntFunction<X> { |
aoqi@0 | 12 | int m(X x); |
aoqi@0 | 13 | } |
aoqi@0 | 14 | |
aoqi@0 | 15 | interface Function<X, Y> { |
aoqi@0 | 16 | Y m(X x); |
aoqi@0 | 17 | } |
aoqi@0 | 18 | |
aoqi@0 | 19 | <T,R> void m1(List<T> s, Function<T,R> f) { } |
aoqi@0 | 20 | <T,R> void m1(List<T> s, ToIntFunction<T> f) { } |
aoqi@0 | 21 | |
aoqi@0 | 22 | <T,R> List<R> m2(List<T> s, Function<T,R> f) { return null; } |
aoqi@0 | 23 | <T,R> List<R> m2(List<T> s, ToIntFunction<T> f) { return null; } |
aoqi@0 | 24 | |
aoqi@0 | 25 | <T,R> List<T> m3(List<T> s, Function<T,R> f) { return null; } |
aoqi@0 | 26 | <T,R> List<R> m3(List<T> s, ToIntFunction<T> f) { return null; } |
aoqi@0 | 27 | |
aoqi@0 | 28 | <T,R> List<T> m4(List<T> s, Function<T,R> f) { return null; } |
aoqi@0 | 29 | <T,R> List<T> m4(List<T> s, ToIntFunction<T> f) { return null; } |
aoqi@0 | 30 | |
aoqi@0 | 31 | <T,R> List<R> m5(List<T> s, Function<T,R> f) { return null; } |
aoqi@0 | 32 | <T,R> List<T> m5(List<T> s, ToIntFunction<T> f) { return null; } |
aoqi@0 | 33 | |
aoqi@0 | 34 | <T extends R,R> List<R> m6(List<T> s, Function<T,R> f) { return null; } |
aoqi@0 | 35 | <T extends R,R> List<T> m6(List<T> s, ToIntFunction<T> f) { return null; } |
aoqi@0 | 36 | |
aoqi@0 | 37 | void test(List<String> ss) { |
aoqi@0 | 38 | m1(ss, s->s.length()); //ambiguous |
aoqi@0 | 39 | m2(ss, s->s.length()); //ambiguous |
aoqi@0 | 40 | m3(ss, s->s.length()); //ambiguous |
aoqi@0 | 41 | m4(ss, s->s.length()); //ambiguous |
aoqi@0 | 42 | m5(ss, s->s.length()); //ambiguous |
aoqi@0 | 43 | m6(ss, s->s.length()); //ambiguous |
aoqi@0 | 44 | } |
aoqi@0 | 45 | } |