cl: funcName check $bound

This commit is contained in:
visualfc
2025-05-15 21:01:56 +08:00
parent 93b9b7d44c
commit c4f0dd124d
6 changed files with 157 additions and 11 deletions

View File

@@ -402,6 +402,10 @@ func funcName(pkg *types.Package, fn *ssa.Function, org bool) string {
recv = parent.Signature.Recv()
} else {
recv = fn.Signature.Recv()
// check $bound
if recv == nil && strings.HasSuffix(fn.Name(), "$bound") && len(fn.FreeVars) == 1 {
recv = types.NewVar(token.NoPos, nil, "", fn.FreeVars[0].Type())
}
}
var fnName string
if org := fn.Origin(); org != nil {