Aladdin - Scala Bugtracking
[#328] project: compiler priority: high category: bug
submitter assigned to status date submitted
Michel Philippe fixed 2004-05-06 13:52:09.0
subject Wrong unboxing of arrays
code
object Main {
  def f[T1, T2](x: T1 => T2): Unit = ();

  def main(args: Array[String]): Unit = {
    f(args)
  }
}
what happened
A ClassCastException at run-time:
scala $ ~/projects/scala-stable/bin/scala -cp /tmp/ms/classes Main
Exception in thread "main" java.lang.ClassCastException
	at Main$.main(bug_arrays_2.scala)
	at Main.main(bug_arrays_2.scala)
what expected A normal run. It seems that when passing the array to function f, it is passed unboxed, which is incorrect.
[back to overview]
Changes of this bug report
Philippe  edited on  2004-06-03 12:54:07.0
Fixed method coerce in Erasure.