/* * @test /nodynamiccopyright/ * @summary Negative regression test from odersky * @author odersky * * @compile/fail/ref=BadTest3.out -XDrawDiagnostics BadTest3.java */ class BadTest3 { 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 B f(B x) { return x; } 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; } public static void meth() { List xs = nil(); f(null); f(nil()); I i = f(null); J j = f(nil()); } } }