Aladdin - Scala Bugtracking
[#771] project: compiler priority: low category: bug
submitter assigned to status date submitted
Stephane Martin fixed 2006-10-06 15:48:38.0
subject Compiler crash in type checker
code
class Foo(s: String) {
  final val s = "abc"
}
what happened
test.scala:2 error: s is already defined as value s
  final val s = "abc"
            ^
Exception in thread "main" java.lang.AssertionError: assertion failed: final private  val s = "abc"
        at scala.Predef$.assert(Predef.scala:95)
        at scala.tools.nsc.typechecker.Typers$Typer.addGetterSetter(Typers.scala:725)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$21.apply(Typers.scala:771)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$21.apply(Typers.scala:771)
        at scala.List.flatMap(List.scala:931)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:771)
        at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:698)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1548)
        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
test.scala:2 error: s is already defined as value s
  final val s = "abc"
            ^
one error found
[back to overview]
Changes of this bug report
Martin  edited on  2006-10-06 17:07:05.0