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/go/types/typeutil: wrong computed method set #37081
Comments
But |
But reflect says it hasn't. |
Did you reverse "what did you expect to see" and "what did you see instead"? Hmmm, looks like you did. When I run the program, it prints |
Oh, sorry, I get it now. The method should be hidden by the field of the same name. The reflect package sees that, but golang.org/x/tools/go/types/typeutil does not. We appreciate the bug reports, but it will save time if you can say more clearly what the issue is, rather than leaving us to work it out. Thanks. |
CC @griesemer |
Smaller reproducer: https://play.golang.org/p/TRM-fN9nvVd The primary function (As an aside, types.NewMethodSet is not directly used by |
Change https://golang.org/cl/218617 mentions this issue: |
Change https://golang.org/cl/218618 mentions this issue: |
After fixing #37081 we don't need to explicitly keep track of field collisions in the method set computation anymore; we only need to know which field (names) exists at each embedding level. Simplify the code by removing the dedicated fieldSet data type in favor of a simple string set. Follow-up on https://golang.org/cl/218617; separate CL to make it easier to identify a problem with these two changes, should there be one. Updates #37081. Change-Id: I5c259c63c75a148a42d5c3e1e4860e1ffe5631bd Reviewed-on: https://go-review.googlesource.com/c/go/+/218618 Reviewed-by: Alan Donovan <adonovan@google.com>
What version of Go are you using (
go version
)?What did you do?
What did you expect to see?
Type
Conn
has no methods.What did you see instead?
Type
Conn
has one method.The text was updated successfully, but these errors were encountered: