1
0
mirror of https://github.com/golang/go synced 2024-11-18 23:05:06 -07:00

go.tools/go/types: return invalid type (rather than nil) for (*Label).Type()

R=adonovan
CC=golang-dev
https://golang.org/cl/14782043
This commit is contained in:
Robert Griesemer 2013-10-17 10:48:19 -07:00
parent 8bb20b8231
commit 851a7b980a

View File

@ -250,7 +250,7 @@ type Label struct {
}
func NewLabel(pos token.Pos, name string) *Label {
return &Label{object{pos: pos, name: name}}
return &Label{object{pos: pos, name: name, typ: Typ[Invalid]}}
}
func (obj *Label) String() string { return fmt.Sprintf("label %s", obj.Name()) }