From f1b1c2f67fae0598db5c20f324334c23d4cd3038 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Sat, 12 Jun 2021 07:33:18 -0700 Subject: [dev.typeparams] cmd/compile: simplify NewClosureFunc I initially made NewClosureFunc take an "outerfn *Func" parameter because I was planning on having it handle closure naming, until remembering that naming needs to wait until typecheck for noder. We don't actually need the *Func yet, just to know whether it's non-nil. So change the parameter to a bool, which simplifies callers a little. Change-Id: Ie83ee4a1ed0571ac6d3879ffd8474c6c3c1a9ff9 Reviewed-on: https://go-review.googlesource.com/c/go/+/327450 Trust: Matthew Dempsky Run-TryBot: Matthew Dempsky Reviewed-by: Cuong Manh Le TryBot-Result: Go Bot --- src/cmd/compile/internal/typecheck/iimport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/compile/internal/typecheck/iimport.go') diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go index b1b3c27898..81f8ea05d9 100644 --- a/src/cmd/compile/internal/typecheck/iimport.go +++ b/src/cmd/compile/internal/typecheck/iimport.go @@ -1283,7 +1283,7 @@ func (r *importReader) node() ir.Node { // All the remaining code below is similar to (*noder).funcLit(), but // with Dcls and ClosureVars lists already set up - fn := ir.NewClosureFunc(pos, r.curfn) + fn := ir.NewClosureFunc(pos, true) fn.Nname.SetType(typ) cvars := make([]*ir.Name, r.int64()) -- cgit v1.2.3-54-g00ecf