[fpc-devel] Generics

Micha Nelissen micha at neli.hopto.org
Tue Apr 11 18:21:01 CEST 2006


On Tue, 11 Apr 2006 13:06:27 -0300
"Flávio Etrusco" <flavio.etrusco at gmail.com> wrote:

> > What does type erasure mean without a runtime engine (VM) ?
> 
> That the "template" is not aware of the instantiated type of the
> template parameters, they are only accessed/resolved through oop
> (inheritance/polymorphism).

That's bad. Why not use interfaces instead, then ?

> A VM isn't necessary at all; for instance, J2SE 5 didn't introduce any
> modification in the VM (for supporting generics or anything), and most
> of the compiler changes were only needed because of the Java object
> model.

Yes, that's why generics in Java suck ;-). At least, according to (first
google hit for "type erasure"):

http://cakoose.com/wiki/type_erasure_is_not_evil

Micha



More information about the fpc-devel mailing list