-
Notifications
You must be signed in to change notification settings - Fork 170
Give a warning for declarations of the form a: a
?
#466
Comments
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
|
a: a
?
For reference, the discussion with Ian Cottrell on Slack: |
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 |
This issue has been migrated to cue-lang/cue#466. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
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: