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/structs: decide how MinFields and MaxFields should behave with required fields #3141

Open
mvdan opened this issue May 13, 2024 · 0 comments

Comments

@mvdan
Copy link
Member

mvdan commented May 13, 2024

From https://review.gerrithub.io/c/cue-lang/cue/+/1194515/comments/4fc29f3a_d942865e:

A question remains whether we should count required fields. With this change they are not counted. (The IsOptional method is inappropriately named, a remnant from when we did not have required fields.) Technically, required fields are not fields. So that means this change is correct. On the other hand, if we have, say, a MaxFields of 1, and we have two required fields, we know there is no completed configuration that can ever satisfy this constraint.

I'm inclined to say that we should count required fields for both MinFields and MaxFields, but this can be left for another CL.

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