aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/noder.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2017-02-01 15:13:48 -0800
committerMatthew Dempsky <mdempsky@google.com>2017-02-02 04:25:23 +0000
commit16dd0624c204ced87ea950b129c5c26d82e2aad4 (patch)
treef6a6b7d03c08c5b1513c77601f9e6a4463826758 /src/cmd/compile/internal/gc/noder.go
parent99e1e4f657c24769a2b42a4aa26c226b6e1db915 (diff)
downloadgo-16dd0624c204ced87ea950b129c5c26d82e2aad4.tar.xz
cmd/compile/internal/gc: add comment and test for #15550
When switching to the new parser, I changed cmd/compile to handle iota per an intuitive interpretation of how nested constant declarations should work (which also matches go/types). Note: if we end up deciding that the current spec wording is intentional (i.e., confirming gccgo's current behavior), the test will need to be updated to expect 4 instead of 1. Updates #15550. Change-Id: I441f5f13209f172b73ef75031f2a9daa5e985277 Reviewed-on: https://go-review.googlesource.com/36122 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/gc/noder.go')
-rw-r--r--src/cmd/compile/internal/gc/noder.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go
index 912652110c..482578d10a 100644
--- a/src/cmd/compile/internal/gc/noder.go
+++ b/src/cmd/compile/internal/gc/noder.go
@@ -204,6 +204,9 @@ func (p *noder) varDecl(decl *syntax.VarDecl) []*Node {
return variter(names, typ, exprs)
}
+// constState tracks state between constant specifiers within a
+// declaration group. This state is kept separate from noder so nested
+// constant declarations are handled correctly (e.g., issue 15550).
type constState struct {
group *syntax.Group
typ *Node