[#996] | project: compiler | priority: medium | category: bug | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Iulian | Martin | won't fix | 2007-03-13 10:07:53.0 | |
subject | erasure does not erase in package scala | |||
code |
package scala class Array { def deep(e: Any): String = e match { // case s: Seq[_] => s.toString case _ => e.toString } } |
|||
what happened | dragos@lamppc27 bugs $ bscalac -d classes/ deep.scala -print:mix [[syntax trees at end of mixin]]// Scala source: deep.scala package scala { class Array extends java.lang.Object { def deep(e: scala.Any): java.lang.String = { |
|||
what expected | scala.Any should be erased to java.lang.Object. This problem crashes the backend later on, since it cannot find the right java type for scala.Any. It is weird that it only happens if the class is in package scala, and the name of the class is Array (haven't tried too many other classes in package scala, though). | |||
[back to overview] |
Martin edited on 2007-03-14 15:28:17.0 |
I believe users should not add classes to package scala, and certainly not change classes like Array. I don't see we need to enforce this, though. Basically, users add to scala at their own risk. So I don't think anything needs to be done here. |
Stephane edited on 2007-03-16 11:15:09.0 |
Reopened bug (see Iulian's answer in scala-dev) |
Stephane edited on 2007-03-16 12:53:09.0 |
deepToString implemented in scala.runtime.Boxed<..>, not in scala.Array |