2008-04-09 13:45:50 +00:00
|
|
|
/*
|
2014-07-17 16:56:07 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2008-04-09 13:45:50 +00:00
|
|
|
* @bug 6450290
|
|
|
|
* @summary Capture of nested wildcards causes type error
|
|
|
|
* @author Maurizio Cimadamore
|
2014-07-17 16:56:07 +00:00
|
|
|
* @compile/fail/ref=T6450290.out -XDrawDiagnostics T6450290.java
|
2008-04-09 13:45:50 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class T6450290 {
|
|
|
|
static class Box<X extends Box<?,?>, T extends X> {
|
|
|
|
T value;
|
|
|
|
Box<X, T> same;
|
|
|
|
}
|
|
|
|
|
|
|
|
static class A extends Box<A,A> {}
|
|
|
|
static class B extends Box<B,B> {}
|
2023-01-17 04:43:40 +00:00
|
|
|
public static void meth() {
|
2008-04-09 13:45:50 +00:00
|
|
|
Box<?,?> b = new Box<Box<A,A>,Box<A,A>>();
|
|
|
|
b.value.same = new Box<B,B>(); //javac misses this bad assignment
|
|
|
|
}
|
|
|
|
}
|