type go/types.Scope
60 uses
go/types (current package)
api.go#L315: Scopes map[ast.Node]*Scope
check.go#L74: scope *Scope // top-most scope for lookups
check.go#L96: func (env *environment) lookupScope(name string) (*Scope, Object) {
check.go#L123: scope *Scope
decl.go#L17: func (check *Checker) declare(scope *Scope, id *ast.Ident, obj Object, pos token.Pos) {
eval.go#L58: var scope *Scope
iter.go#L73: func (s *Scope) Children() iter.Seq[*Scope] {
iter.go#L74: return func(yield func(child *Scope) bool) {
labels.go#L96: func (check *Checker) blockBranches(all *Scope, parent *block, lstmt *ast.LabeledStmt, list []ast.Stmt) []*ast.BranchStmt {
object.go#L30: Parent() *Scope // scope in which this object is declared; nil for methods and struct fields
object.go#L61: setParent(*Scope)
object.go#L102: parent *Scope
object.go#L145: func (obj *object) Parent() *Scope { return obj.parent }
object.go#L173: func (obj *object) setParent(parent *Scope) { obj.parent = parent }
object.go#L437: func (obj *Func) Scope() *Scope { return obj.typ.(*Signature).scope }
package.go#L18: scope *Scope
package.go#L52: func (pkg *Package) Scope() *Scope {
recording.go#L172: func (check *Checker) recordScope(node ast.Node, scope *Scope) {
resolver.go#L22: file *Scope // scope of file containing this declaration
resolver.go#L237: fileScopes := make([]*Scope, len(check.files)) // fileScopes[i] corresponds to check.files[i]
scope.go#L25: type Scope struct {
scope.go#L26: parent *Scope
scope.go#L27: children []*Scope
scope.go#L37: func NewScope(parent *Scope, pos, end token.Pos, comment string) *Scope {
scope.go#L38: s := &Scope{parent, nil, 0, nil, pos, end, comment, false}
scope.go#L48: func (s *Scope) Parent() *Scope { return s.parent }
scope.go#L51: func (s *Scope) Len() int { return len(s.elems) }
scope.go#L54: func (s *Scope) Names() []string {
scope.go#L66: func (s *Scope) NumChildren() int { return len(s.children) }
scope.go#L69: func (s *Scope) Child(i int) *Scope { return s.children[i] }
scope.go#L73: func (s *Scope) Lookup(name string) Object {
scope.go#L94: func (s *Scope) Insert(obj Object) Object {
scope.go#L118: func (s *Scope) _InsertLazy(name string, resolve func() Object) bool {
scope.go#L126: func (s *Scope) insert(name string, obj Object) {
scope.go#L138: func (s *Scope) WriteTo(w io.Writer, n int, recurse bool) {
scope.go#L159: func (s *Scope) String() string {
scope.go#L168: parent *Scope
scope.go#L201: func (*lazyObject) Parent() *Scope { panic("unreachable") }
scope.go#L214: func (*lazyObject) setParent(*Scope) { panic("unreachable") }
scope2.go#L24: func (s *Scope) LookupParent(name string, pos token.Pos) (*Scope, Object) {
scope2.go#L37: func (s *Scope) Pos() token.Pos { return s.pos }
scope2.go#L38: func (s *Scope) End() token.Pos { return s.end }
scope2.go#L43: func (s *Scope) Contains(pos token.Pos) bool {
scope2.go#L52: func (s *Scope) Innermost(pos token.Pos) *Scope {
signature.go#L28: scope *Scope // function scope for package-local and non-instantiated signatures; nil otherwise
stmt.go#L58: func (check *Checker) usage(scope *Scope) {
stmt.go#L412: defer func(scope *Scope) {
universe.go#L19: var Universe *Scope
golang.org/x/tools/go/packages
packages.go#L1192: Scopes: make(map[ast.Node]*types.Scope),
golang.org/x/tools/go/types/objectpath
objectpath.go#L128: scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects
objectpath.go#L801: func (enc *Encoder) scopeObjects(scope *types.Scope) []types.Object {
objectpath.go#L804: m = make(map[*types.Scope][]types.Object)
golang.org/x/tools/internal/gcimporter
ureader_yes.go#L742: func pkgScope(pkg *types.Package) *types.Scope {
golang.org/x/tools/internal/typesinternal
types.go#L152: Scopes: map[ast.Node]*types.Scope{},