Aladdin - Scala Bugtracking
[#972] project: compiler priority: low category: bug
submitter assigned to status date submitted
Iulian Iulian fixed 2007-03-01 10:56:48.0
subject [contrib #356] Compiler crash with error about anchoring a label
code
package test;

object LoanPattern extends Application {
  def foo {
    var x = 0
    try {
      x = x + 1
    } finally {
      (null: Option[Int]) match {
        case None =>
        case Some(x) =>
      }
    }
  }
}
what happened
C:\tmp\eclipse-workspace\scalaProject\src\test>scalac LoanPattern.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: Cannot anchor an already anchored label!
\

        at scala.Predef$.assert(Predef.scala:89)
        at scala.tools.nsc.backend.icode.GenICode$Label.anchor(GenICode.scala:1805)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(
GenICode.scala:378)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(
GenICode.scala:860)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$5$$anonfun$8.apply(GenICode.scala:497)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$5$$anonfun$8.apply(GenICode.scala:494)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$Context$$anonfun$30.apply(GenICode.scala:1764)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$Context$$anonfun$30.apply(GenICode.scala:1762)
        at scala.List.map(List.scala:673)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$Context.Try(GenICode.scala:1762)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(
GenICode.scala:517)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$\
genLoad(
GenICode.scala:860)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:108)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$0.apply(GenICode.scala:67)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$0.apply(GenICode.scala:66)
        at scala.List.foreach(List.scala:702)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:66)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:128)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:85)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$0.apply(GenICode.scala:67)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$0.apply(GenICode.scala:66)
        at scala.List.foreach(List.scala:702)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:66)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:78)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:62)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:58)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:230)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:219)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$2.apply(Global.scala:219)
        at scala.Iterator$class.foreach(Iterator.scala:377)
        at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:244)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:219)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:52)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:484)
        at scala.tools.nsc.Global$Run.compile(Global.scala:555)
        at scala.tools.nsc.Main$.process(Main.scala:59)
        at scala.tools.nsc.Main$.main(Main.scala:81)
        at scala.tools.nsc.Main.main(Main.scala)
what expected No Crash
[back to overview]
Changes of this bug report
Iulian  edited on  2007-03-01 10:57:19.0
Iulian  edited on  2007-03-01 15:47:50.0