Aladdin - Scala Bugtracking
[#65] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Erik Michel fixed 2003-07-10 14:12:53.0
subject java.lang.AbstractMethodError
code
class Queue[+A](elem: A*) {
    protected val in:List[A] = Nil;
    protected val out = elem as List[A];

    protected def mkQueue[A](i:List[A], o:List[A]):Queue[A] = {
	new Queue[A](){
	    override protected val in = i;
	    override protected val out = o
	};
    }

    def +[B >: A](elem: B) = {
	mkQueue(elem::in,out);
    }
}


object Test {
  def main(args: Array[String]): Unit = {
    val q = new Queue();
    val q2 = q + 42 + 0;	

    ();
  }
}
what happened
~/scala/test/bin/scala-test --jvm --show-diff A.scala
[...]
Testing jvm backend
testing: A.scala                                                      [FAILED]
1,4d0
< Exception in thread "main" java.lang.AbstractMethodError
<       at Queue$class.$plus(A.scala:13)
<       at Test$.main(A.scala:21)
<       at Test.main(A.scala)
what expected No runtime excaption.
[back to overview]
Changes of this bug report
Erik  edited on  2003-07-10 14:13:47.0
Erik  edited on  2003-07-10 14:14:06.0
Michel  edited on  2003-07-10 15:28:53.0
It was a bug in the backend, which I hacked.