Skip to content

Commit 81ef6bd

Browse files
committed
internal/core/adt: check right Vertex for single-level close
The condition checked the existing Vertex, instead of the incoming one. Strangely enough, this had no effect. This is probably because n.node was already updated for the fact that v is closed. To make the code more robust to future changes, though, we check the value of v, not n.node. Also updates a comment. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I8129b80632c854ec46c6d54ece022b092542fcf3 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211934 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent f7095a9 commit 81ef6bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: internal/core/adt/typocheck.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func (n *nodeContext) addResolver(v *Vertex, id CloseInfo, forceIgnore bool) Clo
262262
return id
263263
}
264264

265-
isClosed := id.FromDef || n.node.ClosedNonRecursive
265+
isClosed := id.FromDef || v.ClosedNonRecursive
266266

267267
if isClosed {
268268
for i, x := range n.reqDefIDs {
@@ -623,7 +623,7 @@ outer:
623623
} else {
624624
temp = append(temp, buf...)
625625
}
626-
buf = buf[:0] // TODO: perf use OpContext buffer.
626+
buf = buf[:0] // TODO(perf): use OpContext buffer.
627627
}
628628
}
629629

0 commit comments

Comments
 (0)