Aladdin - Scala Bugtracking
[#765] project: compiler priority: high category: bug
submitter assigned to status date submitted
Stephane Martin fixed 2006-10-03 13:45:09.0
subject Compiler crash in type checker
code
object test {
  for (val e <- List()) { //required
    val bar = new Bar
    val res = bar.f       //required
    ()
  }
}
what happened
test.scala:3 error: recursive value bar needs type
    val bar = new Bar
        ^
Exception in thread "main" java.lang.Error: unexpected tree: <type ?>
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1858)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1872)
        at scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:1922)
        at scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:770)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1541)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1872)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1900)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1074)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1095)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1095)
        at scala.List$.loop$0(List.scala:239)
        at scala.List$.mapConserve(List.scala:256)
       [...]
what expected
test.scala:3 error: not found: type Bar
    val bar = new Bar
                  ^
one error found
[back to overview]
Changes of this bug report
Stephane  edited on  2006-10-03 13:45:48.0
Martin  edited on  2006-10-06 16:14:51.0