File tree 2 files changed +14
-2
lines changed
src/dotty/tools/dotc/transform
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,23 @@ import collection.mutable
47
47
* reverse linearization order, add the following definitions to C:
48
48
*
49
49
* 3.1 (done in `traitInits`) For every concrete trait getter `<mods> def x(): T` in M,
50
- * in order of textual occurrence:
50
+ * in order of textual occurrence, produce the following:
51
+ *
52
+ * 3.1.1 If `x` is also a member of `C`, and M is a Dotty trait:
51
53
*
52
54
* <mods> def x(): T = super[M].initial$x()
53
55
*
56
+ * 3.1.2 If `x` is also a member of `C`, and M is a Scala 2.x trait:
57
+ *
58
+ * <mods> def x(): T = _
59
+ *
60
+ * 3.1.3 If `x` is not a member of `C`, and M is a Dotty trait:
61
+ *
62
+ * super[M].initial$x()
63
+ *
64
+ * 3.1.4 If `x` is not a member of `C`, and M is a Scala2.x trait, nothing gets added.
65
+ *
66
+ *
54
67
* 3.2 (done in `superCallOpt`) The call:
55
68
*
56
69
* super[M].<init>
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ class TraitConstructors extends MiniPhaseTransform with SymTransformer {
23
23
24
24
def transformSym (sym : SymDenotation )(implicit ctx : Context ): SymDenotation = {
25
25
if (sym.isPrimaryConstructor && (sym.owner is Flags .Trait ))
26
- // TODO: Someone needs to carefully check if name clashes are possible with this mangling scheme
27
26
sym.copySymDenotation(name = nme.IMPLCLASS_CONSTRUCTOR )
28
27
else sym
29
28
}
You can’t perform that action at this time.
0 commit comments