We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f6cb08 commit 0a8a2a3Copy full SHA for 0a8a2a3
compiler/src/dotty/tools/dotc/core/Annotations.scala
@@ -61,14 +61,15 @@ object Annotations {
61
def tree(implicit ctx: Context) = body
62
}
63
64
- case class LazyBodyAnnotation(bodyExpr: Context => Tree) extends BodyAnnotation {
+ case class LazyBodyAnnotation(private var bodyExpr: Context => Tree) extends BodyAnnotation {
65
private var evaluated = false
66
private var myBody: Tree = _
67
def tree(implicit ctx: Context) = {
68
if (evaluated) assert(myBody != null)
69
else {
70
evaluated = true
71
myBody = bodyExpr(ctx)
72
+ bodyExpr = null
73
74
myBody
75
0 commit comments