Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eval: unexplained incomplete value error vs evalv2 #3763

Open
myitcv opened this issue Feb 17, 2025 · 1 comment
Open

eval: unexplained incomplete value error vs evalv2 #3763

myitcv opened this issue Feb 17, 2025 · 1 comment
Labels
evaluator evalv3 issues affecting only the evaluator version 3 NeedsInvestigation

Comments

@myitcv
Copy link
Member

myitcv commented Feb 17, 2025

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

$ cue version
cue version v0.0.0-20250217140725-3545df15d578

go version go1.23.5
      -buildmode exe
       -compiler gc
     CGO_ENABLED 1
          GOARCH arm64
            GOOS linux
         GOARM64 v8.0
             vcs git
    vcs.revision 3545df15d578ea77c7463f37d34cbabca36fb05d
        vcs.time 2025-02-17T14:07:25Z
    vcs.modified false
cue.lang.version v0.13.0

Does this issue reproduce with the latest release?

Yes

What did you do?

# -- evalv2 --
env CUE_EXPERIMENT=evalv3=0
exec cue export .
cmp stdout stdout.golden

# -- evalv3 --
env CUE_EXPERIMENT=evalv3=1
env CUE_DEBUG=openinline=0
exec cue export .
cmp stdout stdout.golden

-- x.cue --
package x

_core_v1: {
	#cp: {
		hostPort?: int32
		cp:        int32
	}
}

k: n: n1: {
	_CL: "l"
}

let nc = {
	_ports: [ID=_]: _core_v1.#cp
}

_cl: [ID=_]: nc & {
	_ports: {
		"1": {}
		"2": {}
		"3": {}
	}
}

k: n: [ID=_]: {
	_CL: string
	_cs: (_CL): _cl[(_CL)]
}

for _, n in k.n {
	let cps = [for _, c in n._cs for _, cps in c._ports {cps}]
	ports: [for cp in cps if cp.hostPort != _|_ {
		port: "\(cp.hostPort)"
	}]
}

_cl: l: {}

-- stdout.golden --
{
    "k": {
        "n": {
            "n1": {}
        }
    },
    "ports": []
}

What did you expect to see?

Passing test.

What did you see instead?

# -- evalv2 -- (2.479s)
# -- evalv3 -- (0.498s)
> env CUE_EXPERIMENT=evalv3=1
> exec go run cuelang.org/go/cmd/cue export .
[stderr]
ports: incomplete value list:
    ./x.cue:33:9
exit status 1
[exit status 1]
FAIL: /tmp/testscript1905107241/repro.txtar/script.txtar:11: unexpected command failure

This bisects to https://gerrithub.io/c/cue-lang/cue/+/1206383

@myitcv myitcv added evaluator evalv3 issues affecting only the evaluator version 3 NeedsInvestigation labels Feb 17, 2025
@mpvl
Copy link
Member

mpvl commented Feb 17, 2025

Somewhat simplified:

A: x1: y?: int // needs to be optional
A: x2: y?: int
A: x3: y?: int

if true {
	let Z = [for _, x in A {x}]
	B: [for z in Z if z.y != _|_ { b: 1 }]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluator evalv3 issues affecting only the evaluator version 3 NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

2 participants