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

x/tools/go/types: Move field Recv from Signature to Func #8187

Closed
gordonklaus opened this issue Jun 11, 2014 · 4 comments
Closed

x/tools/go/types: Move field Recv from Signature to Func #8187

gordonklaus opened this issue Jun 11, 2014 · 4 comments

Comments

@gordonklaus
Copy link
Contributor

The Recv field is misplaced.  A function type (types.Signature) cannot have a receiver;
only a function object (types.Func) can.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Moving it would break existing programs; not clear that is worth it.

Labels changed: added repo-tools.

@griesemer
Copy link
Contributor

Comment 2:

Labels changed: added release-none.

Owner changed to @griesemer.

Status changed to Thinking.

@gordonklaus
Copy link
Contributor Author

Comment 3:

On a related note, it would be nice if types.Var had a field "Recv *types.Struct".

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc removed the release-none label Apr 10, 2015
@rsc rsc changed the title go/types: Move field Recv from Signature to Func x/tools/go/types: Move field Recv from Signature to Func Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-tools label Apr 14, 2015
@griesemer
Copy link
Contributor

I have tried this a couple of times, only to run into problems when doing the respective source change. If I recall correctly, in some places we only have (or return) the function type and need access to the receiver, but wouldn't have it anymore if the receiver were moved to the function object; and we cannot easily change that w/o changing a lot of unrelated code as well. Perhaps this can be tried in a version 2...

Independently though, the time for API changes has passed and we cannot change this even if it were easily possibly due to the backward API guarantee we have for the std libs to which go/types now belongs.

@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants