You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Go same-file member calls can resolve to a method on the wrong receiver type #4962
Extracting this file produces Use -> B.apply with confidence=EXTRACTED. Reversing the two method declarations changes the target to A.apply.
Expected: Use resolves to A.apply through the declared receiver type, independently of declaration order. An unknown receiver or a receiver whose type does not define the method must not bind to an unrelated same-named method.
The per-file label_to_nid table includes methods and overwrites entries by bare name. The same-file fast path emits an edge before the receiver-aware resolver can inspect the call. Bare calls to package-level functions can also be captured by a same-named method in this table.
This is separate from package-qualified type resolution: the reproducer uses one file and local types only.
Fixed in 0.9.102 (published to PyPI) via #4966. A Go same-file member call now resolves through the receiver's type instead of a declaration-order-dependent same-named method.
Activity
github-actions commentedon Nov 3, 2026
Thanks for opening this issue, @xiongjianxu. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
fix(go): resolve same-file member calls through receiver types
fix(go): resolve same-file member calls through receiver types
safishamsi commentedon Nov 3, 2026
Fixed in 0.9.102 (published to PyPI) via #4966. A Go same-file member call now resolves through the receiver's type instead of a declaration-order-dependent same-named method.