Skip to content

Patterns are treated differently between v2 and v3 #3813

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

Closed
cuematthew opened this issue Mar 12, 2025 · 2 comments
Closed

Patterns are treated differently between v2 and v3 #3813

cuematthew opened this issue Mar 12, 2025 · 2 comments
Labels
NeedsInvestigation Triage Requires triage/attention

Comments

@cuematthew
Copy link
Contributor

cuematthew commented Mar 12, 2025

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

master, commit 0cd0a0c05996db4f998e2b90b2a70e37fc7d209c

What did you do?

# -- evalv2 --
env CUE_EXPERIMENT=evalv3=0
exec cue eval --out cue ./in.cue
cmp stdout stdout.golden

# -- evalv3 --
env CUE_EXPERIMENT=evalv3=1
exec cue eval --out cue ./in.cue
cmp stdout stdout.golden

-- in.cue --
x: {[string]: _}
x: #d
#d: f: _

y: { x }
y: f: true
-- stdout.golden --
x: {
    f: _
}
#d: {
    f: _
}
y: {
    f: true
}

What did you expect to see?

both v2 and v3 should pass

What did you see instead?

# testscript  /tmp/testscript2.txtar
+ exec /home/matthew/go/bin/testscript -e GOPATH=/home/matthew/go -e CUEHOME=/home/matthew/cue/cue /tmp/testscript2.txtar
# -- evalv2 -- (0.103s)
# -- evalv3 -- (0.152s)
> env CUE_EXPERIMENT=evalv3=1
> exec cue eval --out cue ./in.cue
[stderr]
+ cd /home/matthew/cue/cue/cmd/cue
+ go build
+ exec /home/matthew/cue/cue/cmd/cue/cue eval --out cue ./in.cue
y.f: field not allowed:
    ./in.cue:2:4
    ./in.cue:1:5
    ./in.cue:3:5
    ./in.cue:6:4
[exit status 1]
FAIL: /tmp/testscript184019744/testscript2.txtar/script.txtar:8: unexpected command failure
error running /tmp/testscript2.txtar in /tmp/testscript184019744/testscript2.txtar
@cuematthew cuematthew added NeedsInvestigation Triage Requires triage/attention labels Mar 12, 2025
@cuematthew
Copy link
Contributor Author

(Passes with new closedness).

@cuematthew
Copy link
Contributor Author

Confirmed: with new closedness now landed, this passes.

cueckoo pushed a commit that referenced this issue Mar 20, 2025
For #3813.

Signed-off-by: Paul Jolly <[email protected]>
Change-Id: Ia22c4fe28d3c884daed8f27da63b43cba56a501c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211892
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Triage Requires triage/attention
Projects
None yet
Development

No branches or pull requests

1 participant