Aladdin - Scala Bugtracking
[#597] project: compiler priority: high category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-05-17 14:23:40.0
subject Resident compiler recursion gone wild.
code
test/Test.scala:

package test;

abstract class Base {
  type A <: Ax;
  
  abstract class Ax {
    def a = null;
    def string = "A";
  }
}

trait ExtA extends Base {
  type A <: Ax;
  trait Ax extends super.Ax {
    def b = null;
    override def string = super.string + "B";
  }
}
trait ExtB extends Base {
  type A <: Ax;
  trait Ax extends super.Ax {
    def c = null;
    override def string = super.string + "C";
  }
}

trait ExtC extends ExtA with ExtB {
  type A <: Ax;
  trait Ax extends super[ExtA].Ax with super[ExtB].Ax {
    a
    b
    c
    def d = null;
    override def string = super.string + "D";
  }
}

test/Main.scala

package test;

object Main {
  def main(args : Array[String]) : Unit = {
    new ExtC {
      type A = Ax;
      class Ax extends super.Ax;
    }
  }
}
what happened
Run in resident:
bash-3.00$ ~/runtime-workspace/scala/dists/latest/bin/scalac -resident -d ../bin -sourcepath .

nsc> test/Test.scala

nsc> test/Main.scala
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
I think there is a recursive function gone crazy somewhere.
what expected
[back to overview]
Changes of this bug report
Sean  edited on  2006-05-17 15:30:22.0
This bug really sucks, its making the IDE pretty much useless. I think the problem has to do with using super so the names can remain the same. Before I was mangling my own class names because I wasn't sure how to use super, but at least the IDE didn't hang so much!
Sean  edited on  2006-05-17 15:54:44.0
Found a better way to reproduce bug on command line!
Sean  edited on  2006-05-17 15:55:06.0
Martin  edited on  2006-05-18 18:29:59.0