Aladdin - Scala Bugtracking
[#809] project: compiler priority: high category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-11-09 13:01:04.0
subject Resident compiler/mixin sandwich abstract method error
code
// must be three files
// test/ScannerXXX.scala
package test;
trait ScannerXXX {
  type Node <: NodeImpl;
  type File <: FileImpl;
  trait FileImpl;
  trait NodeImpl;
}
// test/NodeScannerXXX.scala
package test;
trait NodeScannerXXX extends ScannerXXX {
  type File <: FileImpl;
  trait FileImpl extends super.FileImpl {
    def make : Unfixed = null;
  }
  type Unfixed <: Node with UnfixedImpl;
  trait UnfixedImpl extends NodeImpl;
}
// test/Main.scala
package test;
class NewScalaTest4 extends NodeScannerXXX {
  class File extends FileImpl;
  trait Node extends NodeImpl;
  trait Unfixed extends UnfixedImpl with Node;
}
object Main {
  def main(args : Array[String]) : Unit = {
    val test = new NewScalaTest4;
    val file = new test.File;
    val xxx = file.make; // (null, new test.WhitespaceToken("   ") :: Nil);
    Console.println("RESULT " + xxx);
  }
}
what happened
In the compiler:

sean-mcdirmid:~/workspace/test31/src mcdirmid$ ../../scala/build/quick/bin/scalac -d ../bin/ -sourcepath . \
-resident

nsc> test/ScannerXXX.scala test/NodeScannerXXX.scala test/Main.scala

nsc> test/ScannerXXX.scala test/Main.scala
On the command line:
sean-mcdirmid:~/workspace/test31/bin mcdirmid$ ../../scala/build/quick/bin/scala -classpath . test.Main
java.lang.AbstractMethodError: test.NewScalaTest4$File.make()Ltest/ScannerXXX$NodeImpl;
	at test.Main$.main(Main.scala:13)
	at test.Main.main(Main.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:76)
	at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:97)
	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Seems to be another mixin sandwich problem (recompile files around a mixin (NodeScannerXXX) without recompiling \ the mixin itself) and something to do with type parameters. As a matter a fact, I've think I've seen this bug be\ fore in a slightly different form, I can try to dig it up if thats helpful. This bug is MAJORLY annoying for any\ one who heavily uses mixins and auto-build in the IDE (uhm..that means probably just me :) ).
what expected
[back to overview]
Changes of this bug report
Martin  edited on  2006-11-10 16:44:00.0