go.tools/go/types: introduce Func.Scope()
The goal is to allow clients to distinguish function-local objects from package-local objects and identify the specific function by examining its scope. For example, a compiler may need to mangle object names according to the outer function name. R=gri CC=golang-codereviews, golang-dev https://golang.org/cl/52280043
This commit is contained in:
parent
0c15485ecc
commit
a0cc29953e
|
@ -192,6 +192,10 @@ func (obj *Func) FullName() string {
|
|||
return buf.String()
|
||||
}
|
||||
|
||||
func (obj *Func) Scope() *Scope {
|
||||
return obj.typ.(*Signature).scope
|
||||
}
|
||||
|
||||
// A Label represents a declared label.
|
||||
type Label struct {
|
||||
object
|
||||
|
|
Loading…
Reference in New Issue