cue
cue copied to clipboard
evaluator: structural cycle with optional field regression in v0.6
What version of CUE are you using (cue version
)?
# "good" version $ cue version cue version v0.5.0 go version go1.21.0 -buildmode exe -compiler gc DefaultGODEBUG panicnil=1 CGO_ENABLED 1 GOARCH amd64 GOOS linux GOAMD64 v1 # "bad" version $ cue version cue version v0.6.0-alpha.1 go version go1.21.0 -buildmode exe -compiler gc DefaultGODEBUG panicnil=1 CGO_ENABLED 1 GOARCH amd64 GOOS linux GOAMD64 v1
Does this issue reproduce with the latest stable release?
Yes (v0.6.0).
What did you do?
Minimal CUE to reproduce:
package structcycle #A: { B?: #B } #B: { A: #A }
To reproduce it, run cue export
with the above saved to structcycle.cue, or similar.
What did you expect to see?
Result with v0.5.0 ("good"):
$ cue export {}
What did you see instead?
Result with v0.6.0-alpha.1 ("bad"):
$ cue export #B.A: structural cycle
Notes
My antler project is broken by the new behavior. On line 59 of my CUE schema in config.cue, the Run field in #Schedule refers to #Run, which refers to #Schedule through an optional field. This works in v0.5.0, but broke somewhere between v0.5.0 and v0.6.0-alpha.1. I'm unsure of the correct behavior, or if I need to change something in my schema, but I do know the behavior in v0.5.0 was working fine for me. :)