go.tools/go/types: imported structs may contain _ fields
Don't report import errors due to (multiple) _ fields in imported structs. Fixes golang/go#5758. R=adonovan CC=golang-dev https://golang.org/cl/10529043
This commit is contained in:
parent
6740bb0838
commit
124e603d87
|
@ -506,7 +506,10 @@ func (p *gcParser) parseStructType() Type {
|
||||||
if tags != nil {
|
if tags != nil {
|
||||||
tags = append(tags, tag)
|
tags = append(tags, tag)
|
||||||
}
|
}
|
||||||
if alt := scope.Insert(fld); alt != nil {
|
if fld.name == "_" {
|
||||||
|
// blank identifiers are not declared
|
||||||
|
fld.setParent(scope)
|
||||||
|
} else if alt := scope.Insert(fld); alt != nil {
|
||||||
pname := "<no pkg name>"
|
pname := "<no pkg name>"
|
||||||
if pkg := alt.Pkg(); pkg != nil {
|
if pkg := alt.Pkg(); pkg != nil {
|
||||||
pname = pkg.name
|
pname = pkg.name
|
||||||
|
|
Loading…
Reference in New Issue