Community
Participate
Working Groups
I20050426-1700 I'm a bit confused about bounds and erasure of capture, type variable and wildcard bindings. Consider this example: public class Try<T extends Collection> { void m() { List<? extends Collection> wild= null; Collection c= wild.get(0); List<T> var= null; Collection c2= var.get(0); } Calling ITypeBinding#getBounds() on the type bindings of expressions wild.get(0) and var.get(0) currently returns java.lang.Object as first bound of the capture / type variable bindings. => Why is the first bound not Collection (as in JLS3 / java.lang.reflect)? ITypeBinding#getErasure() says it "returns the binding for the erasure of the leftmost bound ...", but for the bindings from above, it returns Collection. => Javadoc and implementation not in sync.
Added GenericTypeTest#test632-633. Tuned compatibility check against array bounded captures.
Fixed
Philippe, your comment 1 seems to be targeted at bug 93082 rather than this one, right?
Oops. Thanks for noticing.
Added ASTConverter15Test#test174&176. Fixed, expected values are now answered.
Verified in I20050510-0010