Aladdin - Scala Bugtracking
[#367] project: compiler priority: low category: bug
submitter assigned to status date submitted
Nikolay Martin fixed 2004-10-01 14:15:58.0
subject [contrib #38] Members of scala.All
code
object Bla {
  def foo(): Unit = (return null).equals(null);
}
what happened
The compiler crashes:
Exception in thread "main" scalac.ApplicationError: unknown node: return {
  null;
  ()
}
        at scalac.Global.fail(Global.java:633)
        at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:557)
        at scalac.backend.jvm.GenJVM.genLoadQualifier(GenJVM.java:587)
        at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:424)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:221)
        at scalac.backend.jvm.GenJVM.genLoad(GenJVM.java:256)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:187)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:230)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:162)
        at scalac.backend.jvm.GenJVM.gen(GenJVM.java:157)
        at scalac.backend.jvm.GenJVM.translate(GenJVM.java:121)
        at scalac.backend.jvm.GenJVMPhase.apply(GenJVMPhase.java:45)
        at scalac.Global.compile(Global.java:381)
        at scalac.Global.compile(Global.java:352)
        at scala.tools.scalac.Main$.main1(Main.scala:42)
        at scala.tools.scalac.Main$.main(Main.scala:28)
        at scala.tools.scalac.Main.main(Main.scala:28)
what expected I would have expected that the type checker is complaining. It shouldn't be possible to return "null" from a method with a return type scala.Unit.
[back to overview]
Changes of this bug report
Nikolay  edited on  2004-10-01 14:19:19.0
Martin  edited on  2004-11-18 15:09:10.0