2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2015-05-15 16:53:42 -07:00
|
|
|
* @test /nodynamiccopyright/
|
|
|
|
* @bug 4736963
|
2007-12-01 00:00:00 +00:00
|
|
|
* @summary Negative regression test from odersky
|
|
|
|
* @author odersky
|
|
|
|
*
|
2015-05-15 16:53:42 -07:00
|
|
|
* @compile/fail/ref=BadTest4.out -XDrawDiagnostics -source 7 BadTest4.java
|
2013-02-12 19:25:09 +00:00
|
|
|
* @compile BadTest4.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
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 <B> List<B> nil() { return new List<B>(); }
|
|
|
|
static <A, B extends A> A f(A x, B y) { return x; }
|
|
|
|
static <A, B extends A> B g(List<A> x, List<B> y) { return y.head; }
|
|
|
|
|
|
|
|
static <A> List<A> cons(A x, List<A> xs) { return xs.prepend(x); }
|
|
|
|
static <A> Cell<A> makeCell(A x) { return new Cell<A>(x); }
|
|
|
|
static <A> A id(A x) { return x; }
|
|
|
|
|
|
|
|
static Integer i = new Integer(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()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|