< prev index next >

test/langtools/tools/javac/generics/odersky/BadTest4.java

Print this page


   1 /*
   2  * @test /nodynamiccopyright/
   3  * @bug 4736963
   4  * @summary Negative regression test from odersky
   5  * @author odersky
   6  *
   7  * @compile/fail/ref=BadTest4.out -XDrawDiagnostics -source 7 BadTest4.java
   8  * @compile BadTest4.java
   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; }
   1 /*
   2  * @test /nodynamiccopyright/
   3  * @bug 4736963
   4  * @summary Negative regression test from odersky
   5  * @author odersky
   6  *
   7  * @compile/fail/ref=BadTest4.out -XDrawDiagnostics -source 7 -Xlint:-options BadTest4.java
   8  * @compile BadTest4.java
   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; }
< prev index next >