Aladdin - Scala Bugtracking
[#983] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Gilles Iulian fixed 2007-03-09 15:21:58.0
subject Accessing runtime.BoxedInt crashes compiler
code
scala.runtime.BoxedChar.box('h')
what happened
Exception in thread "main" java.util.NoSuchElementException: key not found: class BoxedChar
        at scala.collection.Map$class.default(Map.scala:156)
        at scala.collection.mutable.HashMap.default(HashMap.scala:33)
        at scala.collection.Map$class.apply(Map.scala:68)
        at scala.collection.mutable.HashMap.apply(HashMap.scala:33)
        at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$41.apply(GenJVM.scala:796)
        at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$41.apply(GenJVM.scala:655)
        at scala.Iterator$class.foreach(Iterator.scala:380)
        at scala.runtime.BoxedArray$$anon$0.foreach(BoxedArray.scala:43)
        at scala.Iterable$class.foreach(Iterable.scala:197)
        at scala.runtime.BoxedArray.foreach(BoxedArray.scala:22)
        at scala.tools.nsc.backend.icode.BasicBlocks$BasicBlock.traverse(BasicBlocks.scala:91)
        at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genBlock(GenJVM.scala:655)
        at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genBlocks(GenJVM.scala:576)
        at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genCode(GenJVM.scala:566)
        at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genMethod(GenJVM.scala:451)
        at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$6.apply(GenJVM.scala:198)
        at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$6.apply(GenJVM.scala:198)
        at scala.List.foreach(List.scala:702)
        at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genClass(GenJVM.scala:198)
        at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$0.apply(GenJVM.scala:44)
        at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$0.apply(GenJVM.scala:44)
        at scala.Iterator$class.foreach(Iterator.scala:380)
        at scala.collection.Map$$anon$2.foreach(Map.scala:111)
        at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run(GenJVM.scala:44)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:488)
        at scala.tools.nsc.Global$Run.compile(Global.scala:559)
        at scala.tools.nsc.Main$.process(Main.scala:57)
        at scala.tools.nsc.Main$.main(Main.scala:79)
        at scala.tools.nsc.Main.main(Main.scala)
what expected Successful compilation.
[back to overview]
Changes of this bug report
Iulian  edited on  2007-03-09 15:29:32.0
The crash is a bug, but you should use Char.box('h'). This way it doesn't crash, and also guarantees correct translation on .net. ;-)
Iulian  edited on  2007-05-01 09:59:05.0