-
Notifications
You must be signed in to change notification settings - Fork 298
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
"field not allowed" potential regression in evalv3, also with a confusing error path #3637
Comments
@myitcv also correctly points out that line 9 has nothing to do with this error, and should not be part of the error output. |
For Holos, I prefer this were rejected. Each time I've encountered this it's been my mistake accidentally unifying a disallowed field. This usually takes the form of unifying at the wrong level, for example In these cases I wish CUE caught my mistake early and rejected it, ideally right in vscode as a problem. Too often it didn't complain and I spent considerable time hunting down why the final output wasn't what I expected. I know other projects may be relying on this behavior and understand it may be too impactful to change, but Holos is early enough that we are not so for us at least I'd prefer the rejection. Perhaps it could be made a flag to opt-in to rejections? |
To me at least this is clearly a bug in v2. i.e. v3 does the right thing in rejecting with an error (albeit the error message is slight off in terms of its positioning)
This question is really aimed at establishing how painful a transition it might be for some people who (accidentally) rely on v2's behaviour. In case it is a widespread "problem" we can offer means of opting in/out to flag that changes the behaviour to ease the transition. For example, see https://tip.cuelang.org/docs/reference/command/cue-help-environment/, in particular the |
Indeed that's my thinking @myitcv. My initial instinct matches @jeffmccune's, that this particular edge case is clearly a bug and not a particularly tricky one at that. I agree that we should only consider patching this up in v3 for better compatibility, much like |
As of 46fc54a:
I think evalv3 is right in rejecting this;
#Fields & {Routes: _}
should fail as the definition does not allow any fields.However, evalv2 accepted this. Given that we're trying to avoid any regressions in behavior, should evalv3 allow this too?
Also, the error message is rather confusing.
#Schema.Routes
is allowed, and it is even present in the input.The text was updated successfully, but these errors were encountered: