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>
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8016177 8016178
4 * @summary structural most specific and stuckness
5 * @compile/fail/ref=T8016177b.out -XDrawDiagnostics T8016177b.java
6 */
7 class T8016177b {
8 interface ToIntFunction<X> {
9 int m(X x);
10 }
12 interface Function<X, Y> {
13 Y m(X x);
14 }
16 <U, V> Function<U, V> id(Function<U, V> arg) { return null; }
18 <U, V> Function<U, V> id2(Function<U, V> arg) { return null; }
19 <U> ToIntFunction<U> id2(ToIntFunction<U> arg) { return null; }
22 <X,Y,Z> X f(Y arg, Function<Y, Z> f) { return null; }
24 <X,Y,Z> X f2(Y arg, Function<Y, Z> f) { return null; }
25 <X,Y> X f2(Y arg, ToIntFunction<Y> f) { return null; }
27 <T> T g(T arg) { return null; }
29 void test() {
30 g(f("hi", id(x->1))); //ok
31 g(f("hi", id2(x->1))); //ambiguous
32 g(f2("hi", id(x->1))); //ok
33 }
34 }