support Go1.27 generic concrete method - #2395
Conversation
There was a problem hiding this comment.
Review: skip generic methods in method-set processing
This is a small, focused change adding guards to skip uninstantiated generic methods when iterating method sets (compiling methods, building itab/ABI interface method tables, collecting runtime-caller targets) and appending a type-arg suffix for instantiated generic method symbols in funcName.
Correctness: Sound. TypeParams() != nil is the correct idiom here — for *types.Signature/*types.Func it is non-nil only for uninstantiated generics, and this matches the codebase convention documented in ssa/decl.go:239 and the existing precedent guard at cl/compile.go:2456. (The tp != nil && tp.Len() > 0 form in ssa/di.go is for *types.Named, a different case — no need to align.)
Safety/Performance: The .Type().(*types.Signature) assertions operate on values guaranteed to be signatures (method-set selections and *types.Func), so they cannot panic. Guards run before the expensive MethodValue resolution, so they are net-positive at compile time. No issues found.
Only findings — low-priority consistency: The new skip guards are silent, while the analogous precedent in the same file (cl/compile.go:2456) carries an explanatory comment. Adding a one-line rationale at each new guard would match local style and prevent a future reader from mistaking the continue for an accidental early-out. See inline comments.
LLGo baseline benchmarks
Program measurements
Core language and compiler benchmarks
Compared with |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
90ba824 to
23e02c6
Compare
23e02c6 to
b94798b
Compare
No description provided.