diff --git a/src/cmd/compile/internal/noder/writer.go b/src/cmd/compile/internal/noder/writer.go index cc44a80a42e..8765f853623 100644 --- a/src/cmd/compile/internal/noder/writer.go +++ b/src/cmd/compile/internal/noder/writer.go @@ -1281,7 +1281,7 @@ func (w *writer) captureVars(expr *syntax.FuncLit) (closureVars []posObj, locals localsIdx: make(map[types2.Object]int), } - syntax.Walk(expr, &v) + syntax.Walk(expr.Body, &v) return v.closureVars, v.localsIdx }