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: struct.MinFields fails too early under evalv3 #3450

Open
rogpeppe opened this issue Sep 13, 2024 · 0 comments
Open

evalv3: struct.MinFields fails too early under evalv3 #3450

rogpeppe opened this issue Sep 13, 2024 · 0 comments

Comments

@rogpeppe
Copy link
Member

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

67f9dfa9

Does this issue reproduce with the latest stable release?

Yes (v0.10.0)

What did you do?

exec cue vet x.cue
env CUE_EXPERIMENT=evalv3
exec cue vet x.cue

-- x.cue --
import "struct"

#foo: struct.MinFields(1) & {
	run?: string
}

What did you expect to see?

Passing test.

What did you see instead?

> exec cue vet x.cue
> env CUE_EXPERIMENT=evalv3
> exec cue vet x.cue
[stderr]
#foo: invalid value {run?:string} (does not satisfy struct.MinFields(1)): len(fields) < MinFields(1) (0 < 1):
    ./x.cue:3:7
    ./x.cue:3:24
[exit status 1]
FAIL: /tmp/y.txtar:3: unexpected command failure

The vet should not fail with a definition that could have more fields in it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant