Skip to content

Commit 90e4d4f

Browse files
committed
Fix omission in CtxLazy
1 parent 6ed401c commit 90e4d4f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/dotty/tools/dotc/transform/CtxLazy.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ class CtxLazy[T](expr: Context => T) {
1414
private var myValue: T = _
1515
private var forced = false
1616
def apply()(implicit ctx: Context): T = {
17-
if (!forced) myValue = expr(ctx)
17+
if (!forced) {
18+
myValue = expr(ctx)
19+
forced = true
20+
}
1821
myValue
1922
}
2023
}

0 commit comments

Comments
 (0)