Idea how to implement VT/VO compatibility in JVM

Stéphane Épardaud stef at epardaud.fr
Thu Jan 22 14:34:01 UTC 2015


On 01/22/2015 03:30 PM, Vitaly Davidovich wrote:
>
> I don't quite get the elegance comment - there's already nothing 
> elegant about heavy use of reflection.  Yes, it gets the job done in 
> some cases, but it's a minority use case (I hope!).
>
Well, IMO there's a lot more elegance in List<val Date> being an 
instance of List<Object> (variance issues aside).
>
> Also, keep in mind that calling a Collection <?> taking method with 
> value type collections may not be safe as the code in that method may 
> be relying on Object semantics (e.g. locks on objects, compares 
> reference identity, etc); in some ways it's safer to call any T 
> methods because presumably person writing those is conscious of value 
> types being a possibility and also compiler may warn if any 
> assumptions are made about it being an Object.
>
Sure, except it needs to be possible to do ;)



More information about the valhalla-dev mailing list