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
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

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.

@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Jan 31, 2020
@ianlancetaylor ianlancetaylor added this to the Go1.14 milestone Jan 31, 2020
@dmitshur
Copy link
Contributor

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.

@ianlancetaylor
Copy link
Contributor Author

Good point, I agree.

@griesemer
Copy link
Contributor

griesemer commented Jan 31, 2020

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

@gopherbot
Copy link

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

@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.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants