Proposal: Improved Wildcard Syntax for Java (original) (raw)
Joseph D. Darcy Joe.Darcy at Sun.COM
Tue Mar 17 16:02:58 PDT 2009
- Previous message: Proposal: Improved Wildcard Syntax for Java
- Next message: Proposal: Improved Wildcard Syntax for Java
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Howard Lovatt wrote:
2009/3/15 Neal Gafter <neal at gafter.com>:
My main concern is that this sounds like a significant change to the type system, and therefore almost certainly out of scope for project Coin.
There is only one change to the type system; which is to allow covariant assignment, e.g. List lo = new ArrayList(). This isn't a drastic change, arrays already do this.
This is in general not type safe. Arrays allow one to do this because array types are reified and there is a store-check at runtime when writing into an array. Since generics in Java are implemented via erasure, this implementation strategy is not possible for Lists and Sets, etc.
-Joe
- Previous message: Proposal: Improved Wildcard Syntax for Java
- Next message: Proposal: Improved Wildcard Syntax for Java
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]