-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/tools/gopls: missing interfaces in 'implementations' #67041
Comments
Intriguingly this case reduces to |
🍿 yet It must be the case that the |
It must have been broken by https://go.dev/cl/518896. obj and localpkgs are no longer in the same realm 😞 How this was not caught by any of our tests, I don't know. That's quite an oversight. |
Change https://go.dev/cl/581875 mentions this issue: |
Aha: the local query works if it originates from the declaring package, because of the way caching works. |
Interestingly, objects were already being compared from different realms, in test variants. Perhaps I saw that and therefore assumed that the object identity didn't matter... (being generous to myself). The CL above also fixes the pre-existing bug finding local implementations declared in test variants. |
I meant to follow-up this morning but you beat me to it. (Thanks!) I still don't understand why realms (my first thought too) could explain the AssignableTo result in this specific case where the RHS is an interface type with only a public method (Underlying) whose signature doesn't mention a named type (only string). The assignability check shouldn't involve any considerations of Named type identity. |
The CL I sent you contains a fix, along with a test for this regression as well as the preexisting inconsistency I described, and should make the oversight clear. |
Of course, Type. I need more coffee. Or just coffee. Thanks. |
An
implementations
query on*types.Struct
does not report thetypes.Type
interface, nor vice versa.The text was updated successfully, but these errors were encountered: