Aladdin - Scala Bugtracking
[#1242] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Gilles Martin fixed 2007-07-25 18:28:01.0
subject Extending and requiring classes that define (in indirect way) homonymous case classes crashes typer
code
trait A {
  case class Error
}

trait B extends scala.util.parsing.combinator.syntactical.StdTokenParsers { a: A =>
  Error match { case Error() => }
}
what happened
Exception in thread "main" java.lang.AssertionError: assertion failed: B.this.Error
        at scala.Predef$.assert(Predef.scala:96)
        at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:684)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2856)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$100.apply(Typers.scala:2184)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$100.apply(Typers.scala:2184)
        at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:549)
        at scala.tools.nsc.typechecker.Typers$Typer.typedApply$0(Typers.scala:2184)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:2750)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer.typedPattern(Typers.scala:2915)
        at scala.tools.nsc.typechecker.Typers$Typer.typedCase(Typers.scala:1298)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1321)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1320)
        ...
what expected The compiler not crashing. Note that StdTokenParsers's subclass Parsers also defines an Error case class.
[back to overview]
Changes of this bug report
Martin  edited on  2007-07-26 01:00:29.0