diff options
author | Robert Griesemer <gri@golang.org> | 2017-05-22 11:20:34 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2017-05-22 19:20:11 +0000 |
commit | d79bb78a71c6f2084497c1291041aa1fa2325835 (patch) | |
tree | 4d631de8b69b643f6418b8fe96188849faffa8d6 /src/cmd/compile/internal/types/sym.go | |
parent | 8f6d68ebaa660c6db8a87d418e95f8c0d3a221e4 (diff) | |
download | go-d79bb78a71c6f2084497c1291041aa1fa2325835.tar.gz go-d79bb78a71c6f2084497c1291041aa1fa2325835.zip |
cmd/compile: report correct position in redeclaration errors
When restoring syms, we must also restore the original Lastlineno.
Bug introduced with https://golang.org/cl/41390/.
Fixes #20415.
Change-Id: Ie81d36279d717e330951b52f42dcee4b0025b9f0
Reviewed-on: https://go-review.googlesource.com/43811
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types/sym.go')
-rw-r--r-- | src/cmd/compile/internal/types/sym.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/types/sym.go b/src/cmd/compile/internal/types/sym.go index d9b6d92abe..f79b07b16c 100644 --- a/src/cmd/compile/internal/types/sym.go +++ b/src/cmd/compile/internal/types/sym.go @@ -18,15 +18,15 @@ import ( // allows using Sym pointer equality to test for Go identifier uniqueness when // handling selector expressions. type Sym struct { - Importdef *Pkg // where imported definition was found - Linkname string // link name - Lastlineno src.XPos // last declaration for diagnostic + Importdef *Pkg // where imported definition was found + Linkname string // link name // saved and restored by dcopy - Pkg *Pkg - Name string // object name - Def *Node // definition: ONAME OTYPE OPACK or OLITERAL - Block int32 // blocknumber to catch redeclaration + Pkg *Pkg + Name string // object name + Def *Node // definition: ONAME OTYPE OPACK or OLITERAL + Block int32 // blocknumber to catch redeclaration + Lastlineno src.XPos // last declaration for diagnostic flags bitset8 Label *Node // corresponding label (ephemeral) |