@@ -14,15 +14,23 @@ import scala.collection.{ mutable, immutable }
14
14
*
15
15
* So far, we've tried to treat classes and traits in the same way as much as possible.
16
16
* Except, for traits:
17
- * - no field symbols are entered (pretend the val is abstract)
18
- * - lazy val is an abstract getter and a concrete method to compute the rhs (and perform its side-effects)
19
- * - accessors for fields, outer pointers and super calls are abstract
17
+ * - Fields have been removed during Constructors, which also made their accessors abstract,
18
+ * while setting the MIXEDIN flag to track that the accessors need to be implemented here.
19
+ * (Constructors needs to see the fields to the init code to the constructor.
20
+ * Note that getters for vals without storage are concrete already in the trait -- see `typeNeedsNoStorage`)
21
+ * - An outer accessor is abstract
22
+ * - A super accessor is abstract
23
+ * - A lazy val is an abstract getter and a concrete method to compute the rhs (and perform its side-effects)
24
+ * - TODO: (lifted) objects
20
25
*
21
26
* In classes that extends traits, it's time to face the music:
22
- * - an overriding method is added for each trait method definition with the override keyword (TODO: refine)
27
+ * - an overriding method is added for each trait method definition with the override keyword,
28
+ * as well as for each method that occurs more than once in the linearisation:
29
+ * ```trait A { def foo }; trait B { def foo}; class C extends A with B { /* must override foo */ }```
23
30
* - fields are created
24
31
* - accessors are implemented (for fields, outers & supers)
25
32
* - lazy vals get bitmaps, getter does its lazy thing, using the compute method in the trait
33
+ * - TODO: (lifted) objects
26
34
*
27
35
*
28
36
*/
0 commit comments