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: regression in unification with {...} vs evalv2 #3778

Closed
myitcv opened this issue Feb 21, 2025 · 0 comments
Closed

eval: regression in unification with {...} vs evalv2 #3778

myitcv opened this issue Feb 21, 2025 · 0 comments
Labels
evaluator evalv3 issues affecting only the evaluator version 3 NeedsInvestigation

Comments

@myitcv
Copy link
Member

myitcv commented Feb 21, 2025

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

$ cue version
cue version v0.13.0-0.dev.0.20250221114952-15a702eab521

go version go1.24.0
      -buildmode exe
       -compiler gc
  DefaultGODEBUG gotestjsonbuildtext=1,multipathtcp=0,randseednop=0,rsa1024min=0,tlsmlkem=0,x509rsacrt=0,x509usepolicies=0
     CGO_ENABLED 1
          GOARCH arm64
            GOOS linux
         GOARM64 v8.0
             vcs git
    vcs.revision 15a702eab5214e8ee537e74c1ef3c5429a011eca
        vcs.time 2025-02-21T11:49:52Z
    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 x.cue
stderr 'z.b: field not allowed'

# -- evalv3 --
env CUE_EXPERIMENT=evalv3=1
env CUE_DEBUG=openinline=0
! exec cue export x.cue
stderr 'z.b: field not allowed'

-- x.cue --
#x: {
	a?: string
}

#y: #x & {
	...
}

z: #y & {
	a: "ok"
	b: "something"
}

What did you expect to see?

Passing test.

What did you see instead?

# -- evalv2 -- (0.009s)
# -- evalv3 -- (0.053s)
> env CUE_EXPERIMENT=evalv3=1
> env CUE_DEBUG=openinline=0
> ! exec cue export x.cue
[stdout]
{
    "z": {
        "a": "ok",
        "b": "something"
    }
}
FAIL: /tmp/testscript3304954446/repro.txtar/script.txtar:9: unexpected command success

This bisects to https://cuelang.org/cl/1204259

@myitcv myitcv added evaluator evalv3 issues affecting only the evaluator version 3 NeedsInvestigation labels Feb 21, 2025
cueckoo pushed a commit that referenced this issue Feb 24, 2025
Issue #3778

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Iee2b13bbeed2545590cc5b4fff640e913ae01f29
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1209176
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
cueckoo pushed a commit that referenced this issue Feb 24, 2025
The fixes of issue 3778 uncovered that we can
simplify the logic of registering Ellipsis. We
no longer need the initial loop and we no longer
need clear the close flags.

Note that we still need to set the isTotal flag
at the end to ensure that we set it in the right
closeContext if the struct is embedded.

Issue #3778

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Ib06069c88deed6e0be5a7ee1c2f86172727b3beb
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1209178
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
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

1 participant