Re: "Model 2" prototype status

Timo Kinnunen timo.kinnunen at
Wed Aug 5 11:08:15 UTC 2015


What is the goof-up? I can see duplication of static members having several benefits. Off the top of my head:

1) It makes it possible to implement a statically type-safe Collections.emptyList().

2) Adding language support for type-safe generic constants becomes a relatively small addition.

3) It means specializations can have the same lifetimes as their consumers have, meaning they can live within the caller’s classloader rather than being associated with some global registry.

That last point means more opportunities for class unloading, for instance. It also prevents a whole category of bugs -- those triggered when the order classes are loaded changes invisibly -- from arising for specialized types or methods or fields.

Have a nice day,

Sent from Windows Mail

From: Simon Ochsenreither
Sent: ‎Wednesday‎, ‎August‎ ‎5‎, ‎2015 ‎12‎:‎43
To: Vitaly Davidovich
Cc: valhalla-dev at

But at least IDE support can help in the case of mutable structs, while the
duplicated-static-members goof-up is "by design" and can never be fixed anymore.
I would consider that issue to be much worse.
(We are planning to to this in the JVM, right?)

More information about the valhalla-dev mailing list