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
Since nulls are not allowed to be unboxed to values, the following code fails (causing the scrip tests to fail as well).
valchrs:Array[Char] = ...
chrs.toArray
scala>valints=Array(1, 2, 3)
ints:Array[Int] =Array(1, 2, 3)
scala> ints.toArray
java.lang.ClassCastException:null is no Int value
at scala.runtime.BoxesRunTime.unboxToInt(UnknownSource)
at scala.runtime.BoxedAnyArray.unbox(BoxedAnyArray.scala:97)
at scala.runtime.BoxedAnyArray.unbox(BoxedAnyArray.scala:80)
at scala.runtime.BoxedAnyArray.adapt(BoxedAnyArray.scala:205)
at scala.runtime.BoxedAnyArray.copyFrom(BoxedAnyArray.scala:236)
at scala.Array$$.copy(Arr...
The text was updated successfully, but these errors were encountered:
@dubochet said:
Fixed by reverting change in r14428. But issue #602 is broken again.
I wonder if fixing the array copy mechanism wouldn't be better. The fact that it has to unbox each null value in the array to Integer(0) before overwriting it with the copied value just seems wrong.
I reassign this bug to devteam so that the Array expert, whoever that is, can have a look.
If you choose to correct copy, please reapply fix for #602 that is commented out in scala.runtime.BoxesRunTime in the Java and CLDC libraries.
Since nulls are not allowed to be unboxed to values, the following code fails (causing the scrip tests to fail as well).
The text was updated successfully, but these errors were encountered: