-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/go/types/objectpath: remove sorting of Named type methods #61443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Change https://go.dev/cl/517737 mentions this issue: |
Use internal variables as back doors for gopls into the objectpath package, rather than linkname. Using linkname breaks x/tools vendoring. See golang/go#61443 for background as to why this back door is necessary. Change-Id: Iabf6e825d169ac1c4080dc326eccc661eaae7ec6 Reviewed-on: https://go-review.googlesource.com/c/tools/+/517737 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
Elevating this to a proposal, per discussion with @rsc. We need to decide whether it's ok to revert this behavior. Otherwise, we need to propose a new API that disables sorting. |
The current behavior of |
This proposal has been added to the active column of the proposals project |
Have all concerns about this proposal been addressed? |
Based on the discussion above, this proposal seems like a likely accept. |
Change https://go.dev/cl/534139 mentions this issue: |
No change in consensus, so accepted. 🎉 |
As we've seen in #58668 (comment), the sorting of Named type methods can dominate the cost of using the
objectpath
package. In the example there, both gopls and the staticcheck analysis driver are essentially unusable when Named type methods are sorted.Proposal: We propose to remove this sorting, effectively reverting the fix for #44195. We should instead guarantee in our documentation that the order of methods is deterministic, both the compiler and go/types agree on this sorting, and this sorting is preserved by all importers/exporters.
(Aside: I'm going to remove the sorting (conditionally) in gopls now, because this has a large impact on gopls usability. However, whatever back-channels I use to do so should be short-lived, and we should agree on a path forward that works for everyone.)
CC @adonovan @dominikh @griesemer @mdempsky
The text was updated successfully, but these errors were encountered: