Skip to content
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

go/types: what is the new method (*Checker).LookupFieldOrMethod? #36916

Closed
ianlancetaylor opened this issue Jan 31, 2020 · 4 comments
Closed

go/types: what is the new method (*Checker).LookupFieldOrMethod? #36916

ianlancetaylor opened this issue Jan 31, 2020 · 4 comments

Comments

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jan 31, 2020

On tip, there is a new exported method in go/types: (*Checker).LookupFieldOrMethod. That method was not in 1.13. The doc comment for this method is (https://tip.golang.org/pkg/go/types/#Checker.LookupFieldOrMethod)

LookupFieldOrMethod is like the external version but completes interfaces as necessary.

I'm not sure what this means. What is "the external version?" I don't think it's the function LookupFieldOrMethod, as that just calls this method on a nil *Checker, so they do the same thing.

I checked to see if the method could be renamed to lookupFieldOrMethod, but Checker already has a method with that name.

I think this new exported method needs better documentation, and it needs to be mentioned in the release notes. Or, it needs to be unexported.

The method was added for #6977.

@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Jan 31, 2020

Since this affects the public API, I understand we should block the rc1 on having a decision on how to resolve this issue. Please let me know if that isn't the case.

Loading

@ianlancetaylor
Copy link
Contributor Author

@ianlancetaylor ianlancetaylor commented Jan 31, 2020

Good point, I agree.

Loading

@griesemer
Copy link
Contributor

@griesemer griesemer commented Jan 31, 2020

It probably doesn't need to be exported - will investigate.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Jan 31, 2020

Change https://golang.org/cl/217134 mentions this issue: go/types: unexport Checker.LookupFieldOrMethod

Loading

@gopherbot gopherbot closed this in 6e592c2 Jan 31, 2020
@golang golang locked and limited conversation to collaborators Jan 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants