diff --git a/compiler/semantic/scope.go b/compiler/semantic/scope.go index 1f6e873d94..4646429e69 100644 --- a/compiler/semantic/scope.go +++ b/compiler/semantic/scope.go @@ -11,18 +11,13 @@ import ( ) type Scope struct { - parent *Scope - children []*Scope - nvar int - symbols map[string]*entry + parent *Scope + nvar int + symbols map[string]*entry } func NewScope(parent *Scope) *Scope { - s := &Scope{parent: parent, symbols: make(map[string]*entry)} - if parent != nil { - parent.children = append(parent.children, s) - } - return s + return &Scope{parent: parent, symbols: make(map[string]*entry)} } type entry struct {