Open rogpeppe opened 1 year ago
A similar issue occurs just using indexing:
exec cue export x.cue
-- x.cue --
package c
#T: {
p: [...]
_q: [for x in p {x}]
r: _q[0]
}
I'd expect that to be OK because the p
field can later be instantiated with a non-zero-length list, but I see this error:
> exec cue export x.cue
[stderr]
#T.r: index out of range [0] with length 0:
./x.cue:6:8
[exit status 1]
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
What did you do?
What did you expect to see?
A passing testscript test.
What did you see instead?
The argument to
list.Range
is treated as final even though it isn't being emitted.