diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-07-02 16:59:01 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-07-26 18:43:12 +0000 |
commit | bfcb7c4c8adadd6191c3fdacf2b59136b0da5c1c (patch) | |
tree | 24731ce99b2df34efd2c3b64e2710347f35818d3 /src/cmd/compile/internal/noder/reader.go | |
parent | b27c7e30dc5d222766057e62c16cb765b636d244 (diff) | |
download | go-bfcb7c4c8adadd6191c3fdacf2b59136b0da5c1c.tar.gz go-bfcb7c4c8adadd6191c3fdacf2b59136b0da5c1c.zip |
[dev.typeparams] cmd/compile: fix unified IR support for //go:nointerface
This CL changes fixedbugs/issue30862.go into a "runindir" test so that
it can use '-goexperiment fieldtrack' and test that //go:nointerface
works with cmd/compile. In particular, this revealed that -G=3 and
unified IR did not handle it correctly.
This CL also fixes unified IR's support for //go:nointerface and adds
a test that checks that //go:nointerface, promoted methods, and
generics all interact as expected.
Updates #47045.
Change-Id: Ib8acff8ae18bf124520d00c98e8915699cba2abd
Reviewed-on: https://go-review.googlesource.com/c/go/+/332611
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/noder/reader.go')
-rw-r--r-- | src/cmd/compile/internal/noder/reader.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go index 44d1c4f28b..516bf8f1f7 100644 --- a/src/cmd/compile/internal/noder/reader.go +++ b/src/cmd/compile/internal/noder/reader.go @@ -750,13 +750,12 @@ func (r *reader) method() *types.Field { name.Func = ir.NewFunc(r.pos()) name.Func.Nname = name - // TODO(mdempsky): Make sure we're handling //go:nointerface - // correctly. I don't think this is exercised within the Go repo. - r.ext.funcExt(name) meth := types.NewField(name.Func.Pos(), sym, typ) meth.Nname = name + meth.SetNointerface(name.Func.Pragma&ir.Nointerface != 0) + return meth } |