-
Notifications
You must be signed in to change notification settings - Fork 301
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
Give a warning for declarations of the form a: a
?
#466
Comments
Original reply by @mpvl in cuelang/cue#466 (comment) The problem is here:
Here the This is logically should: it is a tautology akin to "a == a", which is why this isn't an error. You can fix this here by writing:
which unshadows the original value. Once you've fixed this, you will also want to write
|
Original reply by @mpvl in cuelang/cue#466 (comment) For reference, the discussion with Ian Cottrell on Slack: |
Original reply by @mpvl in cuelang/cue#466 (comment) For reference here, the discussion with Ian Cottrell on Slack: Ian Cottrell Jan 29th at 8:08 PM Marcel van Lohuizen 23 days ago That said, there is an issue out to treat a: a as an error. That’s hard to justify by itself, but the idea is to make it a vet error, similar to checking fmt parameters in Go: although it is correct, it is almost always erroneous. Ian Cottrell 23 days ago Marcel van Lohuizen 23 days ago Marcel van Lohuizen 23 days ago Ian Cottrell 23 days ago Marcel van Lohuizen 23 days ago Ian Cottrell 23 days ago Marcel van Lohuizen 23 days ago Marcel van Lohuizen 23 days ago Ian Cottrell 23 days ago Kevin Gillette 23 days ago Kevin Gillette 23 days ago Marcel van Lohuizen 22 days ago Marcel van Lohuizen 22 days ago |
Originally opened by @ofw in cuelang/cue#466
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
I tried to merge values from several struct into a new one:
What did you expect to see?
I expected that
ABError
will look like this:What did you see instead?
Eval result:
So the
mapping
field is empty.The text was updated successfully, but these errors were encountered: