what happened |
Compiles fine: Mix is not abstract because def T in Base is defined by the case class factory method implemented\
in Mix. However, on run we get the following exception:
Exception in thread "main" java.lang.NoSuchMethodError: test.Test$Mix.T()Ltest/Test$Mix$T;
at test.Test$Base.T(Test.scala:13)
at test.Test$Base$class.$init$(Test.scala:7)
at test.Test$Base.(Test.scala:13)
at test.Test$.main(Test.scala:15)
at test.Test.main(Test.scala)
I guess the back-end forgot not to generate the T factory method that was promised during type checking. Weird, \
its like the back-end never generates case class factory methods, which is definitely incorrect since being type\
s as methods they can "by-name" implement abstract methods (behavior that I actually depend on). I disassembled \
some of the code and if a case class is created through its factory method, then the back-end emits a new call, \
not a call to the factory method, which is also very incorrect because the factory method can always be overridd\
en.....
Not sure if this is a new problem or old problem, I could have sworn this worked before my pull last week, but n\
o solid evidence.
|