author | darcy |
Thu, 12 Jul 2018 14:13:15 -0700 | |
changeset 51047 | 860a3648c494 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
30721
1024d425d97e
8074425: Group 13b: golden files for tests in tools/javac/generics dir
sogoel
parents:
22448
diff
changeset
|
2 |
* @test /nodynamiccopyright/ |
1024d425d97e
8074425: Group 13b: golden files for tests in tools/javac/generics dir
sogoel
parents:
22448
diff
changeset
|
3 |
* @bug 4736963 |
10 | 4 |
* @summary Negative regression test from odersky |
5 |
* @author odersky |
|
6 |
* |
|
51047
860a3648c494
8028563: Remove javac support for 6/1.6 source and target values
darcy
parents:
47216
diff
changeset
|
7 |
* @compile/fail/ref=BadTest4.out -XDrawDiagnostics -source 7 -Xlint:-options BadTest4.java |
15717 | 8 |
* @compile BadTest4.java |
10 | 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 |
||
37636
6c6e6e25189d
8154504: javac tests fail after JDK API is deprecated
jjg
parents:
30721
diff
changeset
|
33 |
static Integer i = Integer.valueOf(1); |
10 | 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 |
} |