1
0
mirror of https://github.com/golang/go synced 2024-11-26 07:27:59 -07:00

cmd/compile/internal/syntax: fix position of type parameter field

Change-Id: I8bca01b935301e7bd4efa55ed21921dbf31a75b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/344575
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2021-08-24 12:23:28 -07:00
parent 647bef6c59
commit 4158e88f64

View File

@ -1840,7 +1840,11 @@ func (p *parser) paramDeclOrNil(name *Name) *Field {
} }
f := new(Field) f := new(Field)
f.pos = p.pos() if name != nil {
f.pos = name.pos
} else {
f.pos = p.pos()
}
if p.tok == _Name || name != nil { if p.tok == _Name || name != nil {
if name == nil { if name == nil {