File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import dotty.tools.dotc.core.Constants.Constant
15
15
import dotty .tools .dotc .core .Types .MethodType
16
16
import dotty .tools .dotc .core .Names .Name
17
17
import dotty .runtime .LazyVals
18
+ import SymUtils ._
18
19
import scala .collection .mutable .ListBuffer
19
20
import dotty .tools .dotc .core .Denotations .SingleDenotation
20
21
import dotty .tools .dotc .core .SymDenotations .SymDenotation
@@ -78,10 +79,9 @@ class LazyValTranformContext {
78
79
if (! (tree.mods is Flags .Lazy )) tree
79
80
else {
80
81
val isField = tree.symbol.owner.isClass
81
- val isVolatile = tree.symbol.hasAnnotation(defn.VolatileAnnot )
82
82
83
83
if (isField) {
84
- if (isVolatile) transformFieldValDefVolatile(tree)
84
+ if (tree.symbol. isVolatile) transformFieldValDefVolatile(tree)
85
85
else transformFieldValDefNonVolatile(tree)
86
86
}
87
87
else transformLocalValDef(tree)
Original file line number Diff line number Diff line change @@ -20,4 +20,6 @@ class SymUtils(val self: Symbol) extends AnyVal {
20
20
21
21
def isTypeTestOrCast (implicit ctx : Context ): Boolean =
22
22
self == defn.Any_asInstanceOf || self == defn.Any_isInstanceOf
23
+
24
+ def isVolatile (implicit ctx : Context ) = self.hasAnnotation(defn.VolatileAnnot )
23
25
}
You can’t perform that action at this time.
0 commit comments