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
1 changed files with 1 additions and 1 deletions

View File

@ -250,7 +250,7 @@ type Label struct {
} }
func NewLabel(pos token.Pos, name string) *Label { 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()) } func (obj *Label) String() string { return fmt.Sprintf("label %s", obj.Name()) }