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

pkg/list: MatchN does not match in final mode #3519

Open
rogpeppe opened this issue Oct 17, 2024 · 0 comments
Open

pkg/list: MatchN does not match in final mode #3519

rogpeppe opened this issue Oct 17, 2024 · 0 comments
Labels

Comments

@rogpeppe
Copy link
Member

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

$ cue version
16986b2c451c93c6f57d6d48ab570e59cd7782a3

Does this issue reproduce with the latest stable release?

N/A (list.MatchN isn't present in v0.10.0)

What did you do?

! exec cue vet -c list.cue

-- list.cue --
import "list"

a: [{}]
a: list.MatchN(1, {a!: _})

What did you expect to see?

Passing test. The list.MatchN argument should require at least one member in the list that has an a field.

What did you see instead?

> ! exec cue vet -c list.cue
FAIL: y.txtar:1: unexpected command success

It seems that the list.MatchN logic should evaluate in final mode and follow some of the same logic used by the matchN builtin for determining whether to give an incomplete or a permanent error.

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

No branches or pull requests

1 participant