/* * @test /nodynamiccopyright/ * @summary Negative regression test from odersky * @author odersky * * @compile/fail/ref=BadTest.out -XDrawDiagnostics BadTest.java */ class BadTest { static class Main { static List nil() { return new List(); } 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 main(String[] args) { List> as = nil().prepend(makeCell(null)); List> bs = cons(makeCell(null), nil()); List xs = id(nil()); List ys = cons("abc", id(nil())); List zs = id(nil()).prepend("abc"); List> us = id(nil()).prepend(makeCell(null)); List> vs = cons(makeCell(null), id(nil())); System.out.println(nil() instanceof List); nil(); } } }