aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/stencil.go
diff options
context:
space:
mode:
authorDan Scales <danscales@google.com>2021-08-05 23:26:21 -0700
committerDan Scales <danscales@google.com>2021-08-06 18:50:46 +0000
commitac78501b9c4f7458c6b4352b1590db058d9ac27c (patch)
treeac9145d8b3d5eb80df6668272e0ac86e04930c8a /src/cmd/compile/internal/noder/stencil.go
parentf78d538858a2d9aae975b2e2c144d23bcc22c22e (diff)
downloadgo-ac78501b9c4f7458c6b4352b1590db058d9ac27c.tar.gz
go-ac78501b9c4f7458c6b4352b1590db058d9ac27c.zip
[dev.typeparams] cmd/compile: make sure closures inside generic funcs are not compiled
Closures inside generic functions were being added to the g.target.Decls list during noding, just like other closures. We remove generic functions/methods from g.target.Decls, so they don't get compiled (they're only available for export and stenciling). Most closures inside generic functions/methods were similarly being removed from g.target.Decls, because they have a generic parameter. But we need to ensure no closures in generic function/methods are left remaining in g.target.Decls, since we don't want them transformed and compiled. So, we set a flag in (*irgen) that records when we are noding a top-level generic function/method, and don't add any closures to g.target.Decls when the flag is true. Updates #47514 Change-Id: Id66b4c41d307ffa8f54cab6ce3646ade81606862 Reviewed-on: https://go-review.googlesource.com/c/go/+/340258 Trust: Dan Scales <danscales@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/noder/stencil.go')
0 files changed, 0 insertions, 0 deletions