You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrap SeqLiteral of value classes using custom wrapper instead of wrapRefArray
wrapRefArray is defined as:
def wrapRefArray[T <: AnyRef](xs: Array[T]): WrappedArray[T]
After erasure this becomes:
def wrapRefArray(xs: Object[]): WrappedArray
This is fine for value classes as long as arrays are boxed, but once we
change the representation this will result in ClassCastException.
Therefore we introduce a wrapper just for value classes:
def wrapVCArray[T <: AnyVal](xs: Array[T]): WrappedArray[T]
Which is erased to:
def wrapVCArray(xs: Object): WrappedArray
Which lets us represent arrays of value classes using any reference type.
0 commit comments