Skip to content

types: find usages of methods on type aliases - #38

Merged
visualfc merged 1 commit into
mainfrom
fix/types-alias-method-usages
Sep 16, 2026
Merged

visualfc merged 1 commit into
mainfrom
fix/types-alias-method-usages

Conversation

@visualfc

Copy link
Copy Markdown
Owner

Summary

  • go/types keeps receivers such as type Builder = *aBuilder as *types.Alias. Find-usages previously matched only pointers and named types, so LiteIDE/gotools types -use reported the definition and skipped every call site.
  • Unwrap aliases in orgType / parseNamed / parserMethod before matching the underlying named type, and keep a same-object fallback for method uses.

Verification

  • go test -count=1 ./types/
  • Reproduced the original LiteIDE case against llgo/ssa.Builder.ChangeInterface; after the fix, both the definition and expr.go:2079 usage are reported.

go/types keeps receivers such as `type Builder = *aBuilder` as
*types.Alias. parserMethod only unwrapped pointers and named types, so
find-usages reported the definition and skipped every call site.

Unwrap aliases before matching named types, and keep a same-object
fallback for method uses.
@visualfc
visualfc merged commit 310e83f into main Sep 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant