Aladdin - Scala Bugtracking
[#764] project: compiler priority: low category: bug
submitter assigned to status date submitted
Iulian Martin fixed 2006-09-28 14:23:23.0
subject call to non existing method after mixin
code
trait A {
  case class Mumu;
}

class B extends Object with A {}
what happened
Class B will get a method Mumu which corresponds to the case class defined inside trait A. This method forwards \
to A$class.Mumu, but such a method does not exist.

trees after mixin:
  class B extends java.lang.Object with A with scala.ScalaObject {
    case def Mumu(): A$Mumu = A$class.Mumu(B.this);
..
  abstract trait A$class extends  {
    def /*A$class*/$init$($this: A): scala.Unit = {
      ()
    }
  };
what expected No methods mixed in for case class constructors, or at least they should not appear in the AST (I understand they should appear as symbols in the right scope). I could suppress code generation for this special kind of methods, but it seems better not to have them at all. Once again, lax (or lazy) verification by most JVMs makes for this problem going unnoticed since version 2.0.0. :-)
[back to overview]
Changes of this bug report
Martin  edited on  2006-10-06 17:18:55.0