You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cue version
cue version v0.6.1-0.20231110172618-7a4ea8668a03
go version devel go1.22-8da6405e0d Sat Nov 11 02:02:35 2023 +0000
-buildmode exe
-compiler gc
-ldflags -w -s
DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,panicnil=1
CGO_ENABLED 1
GOARCH amd64
GOOS linux
GOAMD64 v3
Does this issue reproduce with the latest stable release?
Yes; verified with v0.6.0 as well as master as of 8f796bf.
What did you do?
go mod tidy
go run main.go
cmp stderr stderr.golden
-- main.go --
package main
import "cuelang.org/go/cue/cuecontext"
func main() {
val := cuecontext.New().CompileString(`[{name: "Bob"}]`)
iter, err := val.List()
if err != nil {
panic(err)
}
for iter.Next() {
println(iter.Selector().Index())
}
}
-- stderr.golden --
0
-- go.mod --
module test
go 1.21
require cuelang.org/go v0.6.0
What did you expect to see?
Success, like with v0.5.0.
What did you see instead?
> go run main.go
[stderr]
panic: Index called on non-index selector
goroutine 1 [running]:
panic({0x90d7e0?, 0xa80610?})
/home/mvdan/tip/src/runtime/panic.go:772 +0x158 fp=0xc00002fdc8 sp=0xc00002fd18 pc=0x43a2f8
cuelang.org/go/cue.Selector.Index({{0xa86f50?, 0xc00000e7b0?}})
$WORK/.gopath/pkg/mod/cuelang.org/[email protected]/cue/path.go:205 +0x45 fp=0xc00002fde8 sp=0xc00002fdc8 pc=0x6d2f65
main.main()
$WORK/main.go:12 +0x10c fp=0xc00002ff50 sp=0xc00002fde8 pc=0x8d85ec
runtime.main()
/home/mvdan/tip/src/runtime/proc.go:271 +0x29d fp=0xc00002ffe0 sp=0xc00002ff50 pc=0x43d91d
runtime.goexit({})
/home/mvdan/tip/src/runtime/asm_amd64.s:1694 +0x1 fp=0xc00002ffe8 sp=0xc00002ffe0 pc=0x46cf21
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes; verified with v0.6.0 as well as master as of 8f796bf.
What did you do?
What did you expect to see?
Success, like with v0.5.0.
What did you see instead?
I bisected this to https://review.gerrithub.io/c/cue-lang/cue/+/552171, which tweaked selectors for required fields.
Thanks to @alecholmez and @jack-bischoff for helping uncover this regression.
The text was updated successfully, but these errors were encountered: