Aladdin - Scala Bugtracking
[#727] project: compiler priority: low category: bug
submitter assigned to status date submitted
Nikolay Burak fixed 2006-09-05 10:26:15.0
subject [contrib #187] Compiler crash with catch case
code
package bug.contrib_187

object X
{
  case class Y() extends Exception("")
}

object Z
{
  def fn = try {
    ()
  } catch {
    case X.Y() => ()
  }
}
what happened
Exception in thread "main" java.lang.AssertionError: assertion failed: (temp0.asInstanceOf$erased[bug.contrib_18\
7.X.Y]():bug.contrib_187.X.Y).$outer
        at scala.Predef$.assert(Predef.scala:182)
        at scala.tools.nsc.typechecker.Typers$Typer.typedSelect$0(Typers.scala:1326)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1746)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1675)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:1852)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1744)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1675)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1048)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$53.apply(Typers.scala:1080)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$53.apply(Typers.scala:1079)
        at scala.List$.map2(List.scala:265)
        at scala.tools.nsc.typechecker.Typers$Typer.typedApply(Typers.scala:1079)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1688)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:1852)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1744)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1675)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:1852)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1744)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1675)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1842)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1024)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1013)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1013)
        at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:907)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1511)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1815)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1848)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$1.transform(ExplicitOuter.scal\
a:395)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:990)
        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$1.transform(ExplicitOuter.scal\
a:350)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$23.apply(Trees.scala:1056)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$23.apply(Trees.scala:1056)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.ast.Trees$Transformer.transformCaseDefs(Trees.scala:1056)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1012)
        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$1.transform(ExplicitOuter.scal\
a:350)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$16.apply(Trees.scala:967)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$16.apply(Trees.scala:966)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1068)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:965)
        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$1.transform(ExplicitOuter.scal\
a:350)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1062)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1060)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1060)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:986)
        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$1.transform(ExplicitOuter.scal\
a:350)
        at scala.tools.nsc.ast.Trees$Transformer.transformTemplate(Trees.scala:1048)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$13.apply(Trees.scala:954)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$13.apply(Trees.scala:953)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1068)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:952)
        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$1.transform(ExplicitOuter.scal\
a:350)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1062)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1060)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1060)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:949)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:949)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1068)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:948)
        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$1.transform(ExplicitOuter.scal\
a:350)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1062)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$25.apply(Trees.scala:1060)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:1060)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:949)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$12.apply(Trees.scala:949)
        at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:1068)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:948)
        at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.transform(ExplicitOuter.scala:143)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anon$1.transform(ExplicitOuter.scal\
a:350)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anonfun$9.apply(ExplicitOuter.scala\
:430)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anonfun$9.apply(ExplicitOuter.scala\
:430)
        at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:71)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer.transform(ExplicitOuter.scala:429)
        at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:1063)
        at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer.transformUnit(ExplicitOuter.scala:41\
9)
        at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:26)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:218)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:207)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:207)
        at scala.Iterator$class.foreach(Iterator.scala:316)
        at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:216)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:207)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:469)
        at scala.tools.nsc.Global$Run.compile(Global.scala:533)
        at scala.tools.nsc.Main$.process(Main.scala:76)
        at scala.tools.nsc.Main$.main(Main.scala:98)
        at scala.tools.nsc.Main.main(Main.scala)
what expected Silent compilation.
[back to overview]
Changes of this bug report
Nikolay  edited on  2006-09-05 10:29:22.0
It crashes in ExplicitOuter so I assign it to Martin.
Martin  edited on  2006-09-05 13:12:44.0
Burak  edited on  2006-09-19 19:54:44.0
I could not reproduce it, but I think it got fixed with the rewrite of ExplicitOuter and the corresponding pattern matcher change -- by the way, ExplicitOuter and Transmatch are now the same phase.