You are worried about unsoundness in Unsafe!? The V there is not idiomatic generics for sure. I suppose it has a marginal value of showing which Object corresponds to the value type. Like a C typedef of void*.
So, what? It’s an internal API. > On May 20, 2026, at 2:10 PM, Remi Forax <[email protected]> wrote: > > Hello, > I wonder why > public native <V> V getFlatValue(Object o, long offset, int layoutKind, > Class<?> valueType); > > and > public native <V> void putFlatValue(Object o, long offset, int layoutKind, > Class<?> valueType, V v); > > are using a type parameter V in such unsound way ? > > Moreover, having methods that are both native and generic may be an issue in > the future, when we try to implement type argument propagation (parametric VM > or not). > > Is there a reason why those two methods are using a type parameter ? > > regards, > Rémi > >
