Skip to content

Commit 31e32be

Browse files
committed
Add short comment calling out circular reference
1 parent 5cd4ed8 commit 31e32be

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sjsonnet/src/sjsonnet/Evaluator.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,9 @@ class Evaluator(
846846
k,
847847
new Val.Obj.Member(e.plus, Visibility.Normal) {
848848
def invoke(self: Val.Obj, sup: Val.Obj, fs: FileScope, ev: EvalScope): Val = {
849+
// There is a circular dependency between `newScope` and `newBindings` because
850+
// bindings may refer to other bindings (e.g. chains of locals that build on
851+
// each other):
849852
lazy val newScope: ValScope = s.extend(newBindings, self, sup)
850853
lazy val newBindings = visitBindings(binds, newScope)
851854
visitExpr(e.value)(newScope)

0 commit comments

Comments
 (0)