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
$ mb-scala
Welcome to Scala version 2.11.6-20150224-172222-092690e7bf (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_80).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def foo[@miniboxed T] = new Array[AnyRef](5).asInstanceOf[Array[T]]
foo: [T]=> Array[T]
Warn, and the second time it happens, run sudo rm -rf / on the guys machine!
The text was updated successfully, but these errors were encountered:
$ mb-scala
Welcome to Scala version 2.11.6-20150224-172222-092690e7bf (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_80).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def foo[@miniboxed T] = new Array[AnyRef](5).asInstanceOf[Array[T]]
foo: [T]=> Array[T]
scala> foo[Int](0) = 5
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [I
... 33 elided
The dirtiest one of all:
Warn, and the second time it happens, run
sudo rm -rf /
on the guys machine!The text was updated successfully, but these errors were encountered: