1 /* 2 * @test /nodynamiccopyright/ 3 * @bug 4736963 4 * @summary Negative regression test from odersky 5 * @author odersky 6 * 7 * @compile/fail/ref=BadTest4.out -XDrawDiagnostics -source 7 BadTest4.java 8 * @compile BadTest4.java 9 */ 10 11 class BadTest4 { 12 13 interface I {} 14 interface J {} 15 static class C implements I, J {} 16 static class D implements I, J {} 17 18 interface Ord {} 19 20 static class Main { 21 22 static C c = new C(); 23 static D d = new D(); 24 25 static <B> List<B> nil() { return new List<B>(); } 26 static <A, B extends A> A f(A x, B y) { return x; } 27 static <A, B extends A> B g(List<A> x, List<B> y) { return y.head; } 28 29 static <A> List<A> cons(A x, List<A> xs) { return xs.prepend(x); } 30 static <A> Cell<A> makeCell(A x) { return new Cell<A>(x); } 31 static <A> A id(A x) { return x; } 32 33 static Integer i = new Integer(1); 34 static Number n = i; 35 36 public static void main(String[] args) { 37 Number x = f(n, i); 38 x = f(i, n); 39 f(cons("abc", nil()), nil()); 40 f(nil(), cons("abc", nil())); 41 } 42 } 43 }