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:
parent
8bb20b8231
commit
851a7b980a
|
@ -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()) }
|
||||||
|
|
Loading…
Reference in New Issue