Apart from the inheritance aspect, is there a di开发者_如何学Cfference between the following class templates:
Assuming trait A { def t : Int } trait B { this: A => } why is it that the compiler doesn\'t \"know\" that I can call t on B?
This is a followup to this question. Why does this code not compile, and how do I fix it? trait Vec[V] { self:V =>
This is a followup to this question. I\'m trying to implement vectors in scala with a generic super class using self-types:
Working through these posts had me thinking I understood self-types, at least somewhat. So I created an example which failed as expected:
I couldn\'t find the answer to this in any other question. Suppose that I have an abstract superclass Abstract0 with two subclasses, Concrete1 and Concrete1. I want to be able to define in Abstract0 s
Say I have the following traits: trait A trait B { this开发者_C百科: A => } trait C extends B // { this: A => }
In Scala, I\'ve seen the const开发者_JAVA技巧ructs trait T extends S and trait T { this: S => used to achieve similar things (namely that the abstract methods in S must be defined before an