-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types: method signatures not identical modulo receiver type parameter names #49912
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
I'm tentatively marking this as okay-after-beta1. Making a decision here could technically constitute an API change, but it seems very obscure and unlikely to be a problem. Others may feel differently. |
@griesemer and I discussed the following:
So we concluded that we should be consistent and ignore the names of receiver type parameters the same way we ignore the names of function type parameters. |
Checking on this as a release blocker. Are there any updates? |
I believe we know how to fix this but haven't gotten around to it. This is primarily and issue for tools and shouldn't affect the beta. |
Will address this by next week. |
As discussed in #50887, we decided/discovered that the best course of action is to do nothing here, but to answer questions about method identity using instantiations with type parameters. |
Consider the following:
For the types in this code, the following holds (in pseudo go/types API):
Identical(T1.Method(0).Type(), T2.Method(0).Type()) == true
Identical(F1.Type(), F2.Type()) == true
Identical(G1[int].Method(0).Type(), G2[int].Method(0).Type()) == true
Identical(G1.Method(0).Type(), G2.Method(0).Type()) == false
(4) is false, because although we consider signatures identical modulo type parameter names, we don't consider methods identical modulo type parameter names. This may be minor, but seems incorrect.
@griesemer what do you think?
The text was updated successfully, but these errors were encountered: