Aladdin - Scala Bugtracking
[#766] project: compiler priority: low category: bug
submitter assigned to status date submitted
Nikolay Martin fixed 2006-10-06 11:24:26.0
subject [contrib #222] unknown identifiers inside for-comprehension crash
code
object B
{
  def a = {
    for (val n <- Nil; val m <- Nil) {
      val p = badIdentifier
      false
    }
  }
}
what happened
Compiler Crash:
> testcase.scala:5 error: recursive value p needs type
>                         val p = nonExistantThing
>                             ^
> Exception in thread "main" java.lang.Error: unexpected tree: 
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1871)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:1935)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:783)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1554)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1913)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1087)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1108)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1108)
>         at scala.List$.loop$0(List.scala:239)
>         at scala.List$.mapConserve(List.scala:256)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1108)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:971)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1581)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1919)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedFunction(Typers.scala:1048)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1625)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1114)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$52.apply(Typers.scala:1145)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$52.apply(Typers.scala:1144)
>         at scala.List$.map2(List.scala:272)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedApply(Typers.scala:1144)
>         at scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$0(Typers.scala:1312)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1757)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1919)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedFunction(Typers.scala:1048)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1625)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:1114)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1118)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1118)
>         at scala.List$.loop$0(List.scala:239)
>         at scala.List$.mapConserve(List.scala:256)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedArgs(Typers.scala:1118)
>         at scala.tools.nsc.typechecker.Typers$Typer.tryTypedArgs$0(Typers.scala:1289)
>         at scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$0(Typers.scala:1319)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1757)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1913)
>         at scala.tools.nsc.typechecker.Typers$Typer.computeType(Typers.scala:1946)
>         at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:471)
>         at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$typeSig(Nam
> ers.scala:531)
>         at scala.tools.nsc.typechecker.Namers$Namer$$anon$0.complete(Namers.scala:306)
>         at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:385)
>         at scala.tools.nsc.symtab.Symbols$Symbol.initialize(Symbols.scala:462)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1539)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1913)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1087)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1108)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1108)
>         at scala.List$.loop$0(List.scala:239)
>         at scala.List$.mapConserve(List.scala:256)
>         at scala.List$.loop$0(List.scala:243)
>         at scala.List$.mapConserve(List.scala:256)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1108)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:773)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:714)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1551)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1913)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1087)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1108)
>         at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1108)
>         at scala.List$.loop$0(List.scala:239)
>         at scala.List$.mapConserve(List.scala:256)
>         at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1108)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1544)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1885)
>         at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1913)
>         at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$1.apply(Analyzer.scala:38)
>         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:220)
>         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:535)
>         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 Compile error to say that badIdentifier cannot be found.
[back to overview]
Changes of this bug report
Nikolay  edited on  2006-10-06 11:25:30.0
Transferred from the main BTS and assigned to Marin
Martin  edited on  2006-10-06 16:15:35.0