Name: rmT116609 Date: 06/17/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b55)
Java HotSpot(TM) Client VM (build 1.5.0-beta3-b55, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
In the following code:
class A {}
class B extends A {}
public class Foo<T> {
public <U extends B> void foo(Foo<? super A> param) {
Foo<U> foo = (Foo<U>)param;
}
}
casting should fail, since the capture of ? super A is not convertible to U
due to bound of U.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compiler must report an error instead of unchecked assignment.
REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 280367)
======================================================================