aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder
diff options
context:
space:
mode:
authorMark Freeman <mark@golang.org>2026-03-30 13:54:14 -0400
committerGopher Robot <gobot@golang.org>2026-03-31 15:05:12 -0700
commit085187dc17f9a335569780ab475fbbbb14d6fad0 (patch)
treea1bba02250797e38d2b3fab36bbc3a68e1f9b867 /src/cmd/compile/internal/noder
parentcafe443251e5c0bd95849a0bd18c014530f3118c (diff)
downloadgo-085187dc17f9a335569780ab475fbbbb14d6fad0.tar.xz
cmd/compile/internal/noder: method expressions have nil implicits
Change-Id: Ia7ba5484ef5258cc8edc19b7d500e334c0e0365d Reviewed-on: https://go-review.googlesource.com/c/go/+/761261 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile/internal/noder')
-rw-r--r--src/cmd/compile/internal/noder/reader.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go
index 3fc6a659d9..7099806cba 100644
--- a/src/cmd/compile/internal/noder/reader.go
+++ b/src/cmd/compile/internal/noder/reader.go
@@ -2874,20 +2874,12 @@ func (r *reader) methodExpr() (wrapperFn, baseFn, dictPtr ir.Node) {
return fn, fn, nil
}
- // TODO(mdempsky): I'm pretty sure this isn't needed: implicits is
- // only relevant to locally defined types, but they can't have
- // (non-promoted) methods.
- var implicits []*types.Type
- if r.dict != nil {
- implicits = r.dict.targs
- }
-
if r.Bool() { // dynamic subdictionary
idx := r.Len()
info := r.dict.subdicts[idx]
explicits := r.p.typListIdx(info.explicits, r.dict)
- shapedObj := r.p.objIdx(info.idx, implicits, explicits, true).(*ir.Name)
+ shapedObj := r.p.objIdx(info.idx, nil, explicits, true).(*ir.Name)
shapedFn := shapedMethodExpr(pos, shapedObj, sym)
// TODO(mdempsky): Is there a more robust way to get the
@@ -2902,10 +2894,10 @@ func (r *reader) methodExpr() (wrapperFn, baseFn, dictPtr ir.Node) {
info := r.objInfo()
explicits := r.p.typListIdx(info.explicits, r.dict)
- shapedObj := r.p.objIdx(info.idx, implicits, explicits, true).(*ir.Name)
+ shapedObj := r.p.objIdx(info.idx, nil, explicits, true).(*ir.Name)
shapedFn := shapedMethodExpr(pos, shapedObj, sym)
- dict := r.p.objDictName(info.idx, implicits, explicits)
+ dict := r.p.objDictName(info.idx, nil, explicits)
dictPtr := typecheck.Expr(ir.NewAddrExpr(pos, dict))
// Check that dictPtr matches shapedFn's dictionary parameter.