Aladdin - Scala Bugtracking
[#545] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Lex Martin fixed 2006-03-11 13:33:06.0
subject compiler crash when error types propagate
code
object Test {
  class Foo
  val foo = new Foo
  val x = foo.blah match {
    case List(x) => x
    case Nil => null
    case _ => throw new Error("too many!")
  }
}
what happened
aaa.scala:4 error: value blah is not a member of Test.this.Foo
  val x = foo.blah match {
             ^
Exception in thread "main" scala.MatchError: 
	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:404)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1510)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1379)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1508)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPattern(Typers.scala:1550)
	at scala.tools.nsc.typechecker.Typers$Typer.typedCase(Typers.scala:838)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$36.apply(Typers.scala:858)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$36.apply(Typers.scala:857)
	at scala.List$.loop$0(List.scala:244)
	at scala.List$.mapConserve(List.scala:261)
	at scala.tools.nsc.typechecker.Typers$Typer.typedCases(Typers.scala:857)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1313)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1508)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1534)
	at scala.tools.nsc.typechecker.Typers$Typer.computeType(Typers.scala:1565)
	at scala.tools.nsc.typechecker.Namers$Namer.liftedTry0$0(Namers.scala:484)
	at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$typeSig(Namers.scala:461)\

	at scala.tools.nsc.typechecker.Namers$Namer$$anon$3.complete(Namers.scala:325)
	at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:342)
	at scala.tools.nsc.symtab.Symbols$Symbol.tpe(Symbols.scala:318)
	at scala.tools.nsc.ast.Trees$class.DefDef(Trees.scala:249)
	at scala.tools.nsc.Global.DefDef(Global.scala:30)
	at scala.tools.nsc.typechecker.Typers$Typer.addGetterSetter(Typers.scala:622)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$22.apply(Typers.scala:660)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$22.apply(Typers.scala:660)
	at scala.List.flatMap(List.scala:933)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:660)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:609)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1190)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1508)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1534)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$43.apply(Typers.scala:927)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$43.apply(Typers.scala:917)
	at scala.List$.loop$0(List.scala:244)
	at scala.List$.mapConserve(List.scala:261)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:917)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1183)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1508)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1534)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$1.apply(Analyzer.scala:39)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:207)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:196)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:196)
	at scala.Iterator$class.foreach(Iterator.scala:264)
	at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:216)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:196)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:421)
	at scala.tools.nsc.Global$Run.compile(Global.scala:479)
	at scala.tools.nsc.Main$.process(Main.scala:60)
	at scala.tools.nsc.Main$.main(Main.scala:80)
	at scala.tools.nsc.Main.main(Main.scala)
what expected It should terminate gracefully, in one way or another.
[back to overview]
Changes of this bug report
Martin  edited on  2006-03-11 23:26:45.0