diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-06-12 07:33:18 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-06-12 15:17:14 +0000 |
commit | f1b1c2f67fae0598db5c20f324334c23d4cd3038 (patch) | |
tree | 40efa9b750e0c8247ef3414b0712f5b619110ffa /src/cmd/compile/internal/typecheck/iimport.go | |
parent | db7c868307c87c5e9338e1cb0b5738eb96a929ad (diff) | |
download | go-f1b1c2f67fae0598db5c20f324334c23d4cd3038.tar.gz go-f1b1c2f67fae0598db5c20f324334c23d4cd3038.zip |
[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 <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iimport.go')
-rw-r--r-- | src/cmd/compile/internal/typecheck/iimport.go | 2 |
1 files changed, 1 insertions, 1 deletions
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()) |