JDK-4888066 : add typesafe arrays, arrays of generic types
  • Type: Enhancement
  • Component: specification
  • Sub-Component: language
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_8,windows_xp
  • CPU: generic,x86
  • Submitted: 2003-07-09
  • Updated: 2006-12-06
  • Resolved: 2006-12-06
Related Reports
Relates :  
See 4856545 (add variance to the generic type system) for background.

We would like to have typesafe versions of arrays, in which store
checks cannot fail.  This would allow arrays to be used with generic
types.  Without typesafe arrays, arrays of generic types are not allowed.
This is necessary for type soundness: because generics are implemented
using erasure, the VM cannot fully check array stores.

See also http://www.daimi.au.dk/~plesner/variance/

Other alterative syntaxes are worth considering, for example


and the wildcard syntax for covariant (readonly) typesafe

EVALUATION We may look at typesafe arrays in the future, but reifying generics is likely to be a higher priority.

EVALUATION Some day, perhaps, but not now. ###@###.### 2003-08-22