mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 04:24:49 +02:00
8187443: Forest Consolidation: Move files to unified layout
Reviewed-by: darcy, ihse
This commit is contained in:
parent
270fe13182
commit
3789983e89
56923 changed files with 3 additions and 15727 deletions
30
test/langtools/tools/javac/generics/odersky/BadTest.java
Normal file
30
test/langtools/tools/javac/generics/odersky/BadTest.java
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @summary Negative regression test from odersky
|
||||
* @author odersky
|
||||
*
|
||||
* @compile/fail/ref=BadTest.out -XDrawDiagnostics BadTest.java
|
||||
*/
|
||||
|
||||
class BadTest {
|
||||
static class Main {
|
||||
|
||||
static <B> List<B> nil() { return new List<B>(); }
|
||||
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; }
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<Cell<String>> as = nil().prepend(makeCell(null));
|
||||
List<Cell<String>> bs = cons(makeCell(null), nil());
|
||||
List<String> xs = id(nil());
|
||||
List<String> ys = cons("abc", id(nil()));
|
||||
List<String> zs = id(nil()).prepend("abc");
|
||||
List<Cell<String>> us = id(nil()).prepend(makeCell(null));
|
||||
List<Cell<String>> vs = cons(makeCell(null), id(nil()));
|
||||
System.out.println(nil() instanceof List<String>);
|
||||
nil();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue