Open
Description
# evalv2
env CUE_EXPERIMENT=evalv3=0
exec cue export in.cue
# evalv3
env CUE_EXPERIMENT=evalv3=1
exec cue export in.cue
-- in.cue --
out: #Exporter & {
_imports: [_branch]
#conf: global: region: "Europe"
}
_branch: {
objects: branch: {
#conf: {...}
region: #conf.global.region
}
imports: [_leaf]
#export: #Exporter & {
_objects: objects
_imports: imports
}
}
_leaf: {
objects: leaf: {
#conf: {...}
region: #conf.global.region
}
#export: #Exporter & {
_objects: objects
}
}
#Exporter: {
CONF=#conf: {...}
_objects: {...}
_imports: [...]
objects: [
// local objects
for name, obj in _objects & {[string]: #conf: CONF} {
(name): obj
},
// transitively imported objects
for import in _imports
for obj in ({#conf: CONF} & import.#export).objects {
obj
},
]
}
As of 9a44314:
# evalv2 (0.008s)
> env CUE_EXPERIMENT=evalv3=0
> exec cue export in.cue
[stdout]
{
"out": {
"objects": [
{
"branch": {
"region": "Europe"
}
},
{
"leaf": {
"region": "Europe"
}
}
]
}
}
# evalv3 (0.006s)
> env CUE_EXPERIMENT=evalv3=1
> exec cue export in.cue
[stderr]
structural cycle:
./in.cue:39:15
[exit status 1]
FAIL: repro-evalv3.txtar:7: unexpected command failure
Reported by @nxcc via a private reproducer. Split off from #3903, which was a smaller reduction of the same code; this reduction is more faithful to what the original private code was actually doing.