/* * @test /nodynamiccopyright/ * @bug 4736963 * @summary Negative regression test from odersky * @author odersky * * @compile/fail/ref=BadTest4.out -XDrawDiagnostics -source 7 -Xlint:-options BadTest4.java * @compile BadTest4.java */ class BadTest4 { interface I {} interface J {} static class C implements I, J {} static class D implements I, J {} interface Ord {} static class Main { static C c = new C(); static D d = new D(); static List nil() { return new List(); } static A f(A x, B y) { return x; } static B g(List x, List y) { return y.head; } static List cons(A x, List xs) { return xs.prepend(x); } static Cell makeCell(A x) { return new Cell(x); } static A id(A x) { return x; } static Integer i = Integer.valueOf(1); static Number n = i; public static void main(String[] args) { Number x = f(n, i); x = f(i, n); f(cons("abc", nil()), nil()); f(nil(), cons("abc", nil())); } } }