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
If we want WrappedArray to allow boxed and unboxed representations we need to drop the element types in elemTag and array, at least in WrappedArray. They are probably safe to keep in the specialized subclasses.
Array(1): Array[Any] creates an Array[Object] (not an Array[Int] cast to Array[Any]). If you cast the WrappedArray to WrappedArray[Int] you end up with an Array[Object] pretending to be an Array[Int]. But there are legitimate ways (without a cast) to end up with the same boxed representation (as in your later comment).
In 2.12, a
mutable.ArraySeq
wraps anArray[AnyRef]
, which means primitives are boxed in the underlying array.WrappedArray
by default uses unboxed arrays for primitives, but it can also wrap an array of boxed primitives.Can / should we make this easier to do?
Also, can we avoid this problem here:
Once things are settled, update the docs at https://github.com/scala/collection-strawman/wiki/FAQ#new-deprecations
The text was updated successfully, but these errors were encountered: