Idea how to implement VT/VO compatibility in JVM

Palo Marton palo.marton at gmail.com
Thu Jan 22 14:08:54 UTC 2015


What Stephane probably needs is something like this:

<I> I java.lang.reflect.Proxy.specializedToBoxed(Class<I> interface, Object
specialized_object);

Which will be just generalized form of:

public static <val T> List<__Boxed T>
java.util.Collections.boxedList(List<T> list)

(But I think that it is very premature to discuss reflection of specialized
generics).


On Thu, Jan 22, 2015 at 2:53 PM, Stéphane Épardaud <stef at epardaud.fr> wrote:

> On 01/22/2015 02:49 PM, Maurizio Cimadamore wrote:
>
>>
>> On 22/01/15 13:47, Stéphane Épardaud wrote:
>>
>>> On 01/22/2015 02:42 PM, Maurizio Cimadamore wrote:
>>>
>>>> That's mostly where I was trying to get at - bridges are a part of your
>>>> approach - but it seems like some other part is missing in order to make
>>>> the approach consistent.
>>>>
>>>
>>> Well, sure, it requires _some_ support for `instanceof` and the
>>> reflection API to handle this. But the reflection API will already have to
>>> be tweaked for value types, so it's not like it's out of the question.
>>>
>> And checkcast.
>>
>> And arraystore (because of dynamic covariance checks).
>>
> OK, that's true. I already knew I wasn't aware of all the consequences of
> this approach, but we're making progress finding them :) Any others you can
> think of?
>



More information about the valhalla-dev mailing list