You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -618,7 +619,7 @@ abstract class Constructors extends Statics with Transform with ast.TreeDSL {
618
619
else constrStatBuf
619
620
620
621
valeffect=
621
-
if (fieldNeeded) {
622
+
if (memoized) {
622
623
valassignSym=
623
624
if (stat.symbol.isGetter) stat.symbol.asInstanceOf[MethodSymbol].referenced //setterIn(clazz, hasExpandedName = false) // not yet expanded -- see Mixin
624
625
else stat.symbol
@@ -630,7 +631,7 @@ abstract class Constructors extends Statics with Transform with ast.TreeDSL {
630
631
constrBufPart += effect
631
632
}
632
633
633
-
fieldNeeded
634
+
memoized
634
635
}
635
636
636
637
@@ -695,12 +696,6 @@ abstract class Constructors extends Statics with Transform with ast.TreeDSL {
695
696
// Triage all template definitions to go into defBuf/auxConstructorBuf, constrStatBuf, or constrPrefixBuf.
696
697
for (stat <- stats) stat match {
697
698
case dd@DefDef(_,_,_,_,_,rhs) =>
698
-
// We can't mark as deferred from the start, as it will be implemented automatically in the subclass
699
-
// it should be marked deferred in bytecode, though
700
-
if (inTrait && stat.symbol.isAccessor) {
701
-
stat.symbol setFlag DEFERRED
702
-
}
703
-
704
699
// methods with constant result type get literals as their body
705
700
// all methods except the primary constructor go into template
706
701
stat.symbol.tpe match {
@@ -710,9 +705,19 @@ abstract class Constructors extends Statics with Transform with ast.TreeDSL {
710
705
if (stat.symbol.isPrimaryConstructor) ()
711
706
elseif (stat.symbol.isConstructor) auxConstructorBuf += stat
712
707
// a concrete getter's RHS is treated like a ValDef (the actual field isn't emitted until Mixin augments the class that inherits the trait)
713
-
elseif (inTrait && stat.symbol.isGetter && (rhs ne EmptyTree)) {
714
-
moveEffectToCtor(dd) // ignore whether we need a field -- it will be added in the inheriting class by Mixin
715
-
defBuf += deriveDefDef(dd)(_ =>EmptyTree)
708
+
elseif (inTrait) {
709
+
// We can't mark as deferred from the start, as it will be implemented automatically in the subclass
710
+
// it should be marked deferred in bytecode, though
0 commit comments