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
gccgo: erroneously accepts duplicate constant keys in map literal #28104
Comments
Change https://golang.org/cl/161357 mentions this issue: |
Change https://golang.org/cl/161357 mentions this issue: |
Updates golang/go#28104 Change-Id: I9f313245b10d4a25549c1099b76eba96e775a0f6 Reviewed-on: https://go-review.googlesource.com/c/161357 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Updates golang/go#28104 Reviewed-on: https://go-review.googlesource.com/c/161357 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268891 138bc75d-0d04-0410-961f-82ee72b054a4
Change https://golang.org/cl/162882 mentions this issue: |
Updates golang/go#28104 Change-Id: Ic31cdf29721d37529ade9c3cd00efa279cb2066f Reviewed-on: https://go-review.googlesource.com/c/162882 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Updates golang/go#28104 Reviewed-on: https://go-review.googlesource.com/c/162882 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269242 138bc75d-0d04-0410-961f-82ee72b054a4
It looks this has been fixed for non-bool keys in the latest gccgo versions. Duplicate bool keys are still allowed: #35945 |
Change https://go.dev/cl/403954 mentions this issue: |
For golang/go#35945 Fixes golang/go#28104 Change-Id: I6d0f3188e99d99e92dabab68949d0d0d24841388 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/403954 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
Under Composite literals, the Go spec says "It is an error to specify multiple elements with the same field name or constant key value."
However, gccgo erroneously accepts this code:
cmd/compile and go/types correctly emit an error.
/cc @ianlancetaylor
The text was updated successfully, but these errors were encountered: