-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
8u202
-
x86_64
-
generic
A DESCRIPTION OF THE PROBLEM :
Error in check of type parameter bounds when wildcard is used as type argument. Same code successfully compiles by Eclipse compiler
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just try to compile provided source code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Successful compilation
ACTUAL -
/TestClass.java:7: error: type argument ? extends B is not within bounds of type-variable E
C<? extends A, ? extends B> b = new C<A, B>();
^
where E,T are type-variables:
E extends T declared in class C
T extends Object declared in class C
1 error
---------- BEGIN SOURCE ----------
public class TestClass {
public static class A {}
public static class B extends A {}
public static class C<T, E extends T> {}
public static void main(String args[]) {
C<? extends A, ? extends B> b = new C<A, B>();
}
}
---------- END SOURCE ----------
FREQUENCY : always
Error in check of type parameter bounds when wildcard is used as type argument. Same code successfully compiles by Eclipse compiler
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just try to compile provided source code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Successful compilation
ACTUAL -
/TestClass.java:7: error: type argument ? extends B is not within bounds of type-variable E
C<? extends A, ? extends B> b = new C<A, B>();
^
where E,T are type-variables:
E extends T declared in class C
T extends Object declared in class C
1 error
---------- BEGIN SOURCE ----------
public class TestClass {
public static class A {}
public static class B extends A {}
public static class C<T, E extends T> {}
public static void main(String args[]) {
C<? extends A, ? extends B> b = new C<A, B>();
}
}
---------- END SOURCE ----------
FREQUENCY : always