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:
Peter Collingbourne 2014-01-14 14:47:27 -08:00 committed by Robert Griesemer
parent 0c15485ecc
commit a0cc29953e
1 changed files with 4 additions and 0 deletions

View File

@ -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