Skip to content

Commit 52c02d0

Browse files
committed
internal/core/adt: do not hasNonCycle in one case
With the structural cycle detection rework, this no longer seems necessary. As it is safer to be non-permissive, we do not set this flag. We leave it in, however, to quickly be able to set it if an issue bisects to this change. Issue #3731 Issue #3634 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ie411bf9eca647e675e5a74b12245175e7aa0909c Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1209385 Reviewed-by: Matthew Sackman <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent e55c7a8 commit 52c02d0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

internal/core/adt/conjunct.go

+7
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ func (n *nodeContext) scheduleConjunct(c Conjunct, id CloseInfo) {
110110
// }
111111
// panic("inconsistent state: nodes differ")
112112
}
113+
// TODO: consider setting this as a safety measure.
114+
// if c.CloseInfo.CycleType > id.CycleType {
115+
// id.CycleType = c.CloseInfo.CycleType
116+
// }
117+
// if c.CloseInfo.IsCyclic {
118+
// id.IsCyclic = true
119+
// }
113120
default:
114121

115122
// In this case, the conjunct is inserted as the result of an expansion

internal/core/adt/unify.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,9 @@ func (v *Vertex) lookup(c *OpContext, pos token.Pos, f Feature, flags combinedFl
764764

765765
// A lookup counts as new structure. See the commend in Section
766766
// "Lookups in inline cycles" in cycle.go.
767-
state.hasNonCycle = true
767+
// TODO: this seems no longer necessary and setting this will cause some
768+
// hangs. Investigate.
769+
// state.hasNonCycle = true
768770

769771
// TODO: ideally this should not be run at this point. Consider under
770772
// which circumstances this is still necessary, and at least ensure

0 commit comments

Comments
 (0)