-
Bug
-
Resolution: Duplicate
-
P3
-
5.0
-
generic
-
generic
import java.util.*;
interface I {}
class A1 {}
class B1 extends A1 implements I {
B1() {}
}
class B2 extends A1 implements I {
B2() {}
}
class Cell<V>
{
V value;
<T extends V> Cell(T a) {value = a;}
V get() { return value; }
}
class Foo {
void test(boolean b){
Cell<? extends B1> cb1 = new Cell<B1>(new B1());
Cell<? extends B2> cb2 = new Cell<B2>(new B2());
Cell<? extends I> c1 = ( b ? cb1 : cb2);
Cell<? extends A1> c2 = ( b ? cb1 : cb2);
}
}
See http://forum.java.sun.com/thread.jspa?threadID=632049&tstart=0
###@###.### 2005-06-01 14:40:03 GMT
interface I {}
class A1 {}
class B1 extends A1 implements I {
B1() {}
}
class B2 extends A1 implements I {
B2() {}
}
class Cell<V>
{
V value;
<T extends V> Cell(T a) {value = a;}
V get() { return value; }
}
class Foo {
void test(boolean b){
Cell<? extends B1> cb1 = new Cell<B1>(new B1());
Cell<? extends B2> cb2 = new Cell<B2>(new B2());
Cell<? extends I> c1 = ( b ? cb1 : cb2);
Cell<? extends A1> c2 = ( b ? cb1 : cb2);
}
}
See http://forum.java.sun.com/thread.jspa?threadID=632049&tstart=0
###@###.### 2005-06-01 14:40:03 GMT
- duplicates
-
JDK-5080917 lub computes strange compound types
- Closed