Aladdin - Scala Bugtracking
[#678] project: compiler priority: low category: bug
submitter assigned to status date submitted
Burak Martin fixed 2006-07-25 19:54:02.0
subject obscure runtime exception
code
object ga2 {
  def foo[A](x:Object):A = x.asInstanceOf[A]
  def main(args:Array[String]):unit = {
    val zx = foo(this) // infers type 'All' ?!
    null
  }
}
what happened
Burak-Emirs-MacBook-Pro:~/Documents/svn/scala buraq$ build/quick/bin/scalac -d /tmp  /tmp/ga2.scala 
Burak-Emirs-MacBook-Pro:~/Documents/svn/scala buraq$ build/quick/bin/scala -classpath /tmp ga
scala.MatchError: ga$@8020cc
        at scala.runtime.ScalaRunTime$.boxArray(ScalaRunTime.scala:122)
        at ga$.main(ga2.scala:8)
        at ga.main(ga2.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:53)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:95)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
what expected everything but a MatchError.
[back to overview]
Changes of this bug report
Martin  edited on  2006-08-20 18:33:53.0