[tools] go/ssa: reject generic methods from RuntimeTypes

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Jun 8, 2026, 4:46:15 PM (3 days ago) Jun 8
to Alan Donovan, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, golang...@luci-project-accounts.iam.gserviceaccount.com, Mark Freeman, Robert Griesemer, golang-co...@googlegroups.com

Gopher Robot submitted the change with unreviewed changes

Unreviewed changes

3 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: go/ssa/ssautil/visit.go
Insertions: 2, Deletions: 3.

@@ -76,10 +76,9 @@
mset := prog.MethodSets.MethodSet(T)
for sel := range mset.Methods() {
// Skip generic methods.
- if sel.Obj().(*types.Func).Signature().TypeParams() != nil {
- continue
+ if sel.Obj().(*types.Func).Signature().TypeParams() == nil {
+ function(prog.MethodValue(sel))
}
- function(prog.MethodValue(sel))
}
}
}
```

Change information

Commit message:
go/ssa: reject generic methods from RuntimeTypes

This CL causes ssautil.AllFunctions and typesinternal.ForEachElement
(used by ssa.Prog.RuntimeTypes) to skip generic methods, which
now appear in the types.MethodSet.

Fixes golang/go#79901
Fixes golang/go#79600
Change-Id: I50a85fdc0eb5879007b28852fb8eccf061e90c81
Reviewed-by: Mark Freeman <markf...@google.com>
Auto-Submit: Alan Donovan <adon...@google.com>
Files:
  • M go/ssa/ssautil/visit.go
  • M internal/typesinternal/element.go
Change size: S
Delta: 2 files changed, 17 insertions(+), 4 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: I50a85fdc0eb5879007b28852fb8eccf061e90c81
Gerrit-Change-Number: 788380
Gerrit-PatchSet: 5
Gerrit-Owner: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Mark Freeman <markf...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages