fork download
  1. object Main extends App {
  2. val ai: AnyRef = Array(1, 2, 3, 4, 5, 6)
  3. val aii: Array[Any] = ai.asInstanceOf[Array[Any]]
  4. val ar: Array[AnyRef] = aii.map(_.asInstanceOf[AnyRef])
  5. }
Runtime error #stdin #stdout #stderr 0.33s 43676KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.lang.ClassCastException: [I cannot be cast to [Ljava.lang.Object;
	at Main$.delayedEndpoint$Main$1(Main.scala:3)
	at Main$delayedInit$body.apply(Main.scala:1)
	at scala.Function0.apply$mcV$sp(Function0.scala:34)
	at scala.Function0.apply$mcV$sp$(Function0.scala:34)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.App.$anonfun$main$1$adapted(App.scala:76)
	at scala.collection.immutable.List.foreach(List.scala:378)
	at scala.App.main(App.scala:76)
	at scala.App.main$(App.scala:74)
	at Main$.main(Main.scala:1)
	at Main.main(Main.scala)