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

evalv3: field unexpectedly allowed with struct disjunction #3606

Open
rogpeppe opened this issue Dec 2, 2024 · 2 comments
Open

evalv3: field unexpectedly allowed with struct disjunction #3606

rogpeppe opened this issue Dec 2, 2024 · 2 comments
Labels
evaluator evalv3 issues affecting only the evaluator version 3 NeedsFix

Comments

@rogpeppe
Copy link
Member

rogpeppe commented Dec 2, 2024

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

$ cue version
0b06bd543bc422ab11be058443a271a6596151ab

Does this issue reproduce with the latest stable release?

Yes, back at least as far as v0.9.2

What did you do?

env CUE_EXPERIMENT=evalv3
! exec cue vet x.cue

-- x.cue --
data: {
	notAllowed: true
} & #S

#S: string | {}

What did you expect to see?

Passing test. The empty struct inside #S should be closed, not allowing any extra fields.

What did you see instead?

> env CUE_EXPERIMENT=evalv3
> ! exec cue vet x.cue
FAIL: /tmp/x.txtar:2: unexpected command success
@mpvl
Copy link
Member

mpvl commented Dec 7, 2024

This seems to have been fixed already.

@myitcv
Copy link
Member

myitcv commented Dec 8, 2024

@mpvl - I've just tested against f99441a and I still see this problem. i.e. @rogpeppe's repro test fails, when it should pass.

@mvdan mvdan added the evalv3 issues affecting only the evaluator version 3 label Dec 10, 2024
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 NeedsFix
Projects
None yet
Development

No branches or pull requests

4 participants