Aladdin - Scala Bugtracking
[#754] project: compiler priority: high category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-09-24 16:25:29.0
subject resident compiler + traits + type params = abstract method error
code
// Three files...
// test/ParserXXX.scala
package test;
trait ParserXXX {
  type Node <: NodeImpl;
  trait NodeImpl {
    
  }
}
// test/BracesXXX.scala
package test;
trait BracesXXX extends ParserXXX {
  type Close <: Node;
  trait OpenImpl extends NodeImpl { 
    def to : Close = null;
    final def matching = to;
  }
}
// test/ScalaTestYYY.scala
package test;
object ScalaTestYYY extends ParserXXX with BracesXXX {
  def main(args : Array[String]) : Unit = {
    Console.println("Hello");
    (new Open).matching;
  }
  type Close = Node;
  class Open extends Node with OpenImpl {
    def self = this;
  }
  abstract class Node extends NodeImpl;
}
what happened
For using resident compiler: 

tsf-wpa-2-067:~/workspace/test20/src mcdirmid$  ../../scala/build/quick/bin/scalac -d ../bin/ -resident

nsc> test/BracesXXX.scala test/ParserXXX.scala test/ScalaTestYYY.scala 

nsc> test/ParserXXX.scala test/ScalaTestYYY.scala 
Running:
mcdirmid% ../../scala/build/quick/bin/scala test.ScalaTestYYY
Hello
java.lang.AbstractMethodError: test.ScalaTestYYY$Open.matching()Ltest/ParserXXX$NodeImpl;
        at test.ScalaTestYYY$.main(ScalaTestYYY.scala:5)
        at test.ScalaTestYYY.main(ScalaTestYYY.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:55)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:96)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Looks like another sandwhich problem.
what expected
[back to overview]
Changes of this bug report
Sean  edited on  2006-09-24 16:26:35.0
Martin  edited on  2006-10-26 16:45:59.0