File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import SymDenotations._
11
11
import Types ._
12
12
import Decorators ._
13
13
import DenotTransformers ._
14
+ import Annotations ._
14
15
import StdNames ._
15
16
import NameOps ._
16
17
import ast .Trees ._
@@ -80,9 +81,14 @@ class AugmentScala2Traits extends MiniPhaseTransform with IdentityDenotTransform
80
81
for (sym <- mixin.info.decls) {
81
82
if (needsForwarder(sym) || sym.isConstructor || sym.isGetter && sym.is(Lazy ))
82
83
implClass.enter(implMethod(sym.asTerm))
83
- if (sym.isGetter && ! sym.is(LazyOrDeferred ) &&
84
- ! sym.setter.exists && ! sym.info.resultType.isInstanceOf [ConstantType ])
85
- traitSetter(sym.asTerm).enteredAfter(thisTransform)
84
+ if (sym.isGetter)
85
+ if (sym.is(Lazy )) {
86
+ if (! sym.hasAnnotation(defn.VolatileAnnot ))
87
+ sym.addAnnotation(Annotation (defn.VolatileAnnot , Nil ))
88
+ }
89
+ else if (! sym.is(Deferred ) && ! sym.setter.exists &&
90
+ ! sym.info.resultType.isInstanceOf [ConstantType ])
91
+ traitSetter(sym.asTerm).enteredAfter(thisTransform)
86
92
if (sym.is(PrivateAccessor , butNot = ExpandedName ) &&
87
93
(sym.isGetter || sym.isSetter)) // strangely, Scala 2 fields are also methods that have Accessor set.
88
94
sym.ensureNotPrivate.installAfter(thisTransform)
You can’t perform that action at this time.
0 commit comments