Skip to content

eval: def regression starting at v0.11.x #3719

@gotwarlost

Description

@gotwarlost

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

$ cue version
cue version v0.12.0

go version go1.23.5
      -buildmode exe
       -compiler gc
  DefaultGODEBUG asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1
     CGO_ENABLED 1
          GOARCH arm64
            GOOS darwin
         GOARM64 v8.0
cue.lang.version v0.12.0

Does this issue reproduce with the latest stable release?

Yes.

What did you do?

Ran the testscript below

# -- evalv2 --
env CUE_EXPERIMENT=evalv3=0
exec cue def ./andbug

# -- evalv3 --
env CUE_EXPERIMENT=evalv3=1
exec cue def ./andbug

-- andbug/one.cue --
package andbug

#request: {...}

knownAtRuntime: #request.foo.bar

works: {
    for k, v in knownAtRuntime.labels {
        (k): v
    }
}

doesNotWork: and([for k, v in knownAtRuntime.labels
    { (k): v}
])

What did you expect to see?

A passing test

What did you see instead?

> exec cue def ./andbug
[stderr]
doesNotWork: cannot use _|_(knownAtRuntime: undefined field: foo) (type _|_) as type list:
    ./andbug/one.cue:13:14
    ./andbug/one.cue:13:18
    ./andbug/one.cue:13:19
[exit status 1]
FAIL: <stdin>:1: unexpected command failure
failed run

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions