cue icon indicating copy to clipboard operation
cue copied to clipboard

evaluator: structural cycle error involving self that doesn't look like a structural cycle

Open rogpeppe opened this issue 2 months ago • 0 comments

What version of CUE are you using (cue version)?

25322aeb9607f29dfb3b4a8cf126e044ed39fe0c

Does this issue reproduce with the latest stable release?

No (the self builtin doesn't exist in the latest stable release).

What did you do?

exec cue export -e _all x.cue
cmp stdout want-stdout

-- x.cue --
@experiment(aliasv2)

package config
import "strings"

let Self = self

_all: [
	for topLevelField in Self
	for _ in topLevelField {}
]

let p = strings.ToUpper("")

f: (strings.Join([p, "test"], "")): {}

-- want-stdout --
[
    {}
]

What did you expect to see?

A passing test. This doesn't look like a structural cycle to me.

What did you see instead?

> exec cue export -e _all x.cue
[stderr]
0: structural cycle:
    ./x.cue:15:5
[exit status 1]
FAIL: /tmp/x.txtar:1: unexpected command failure

rogpeppe avatar Oct 30 '25 14:10 rogpeppe