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: export Original function (or perhaps method) #17730

Closed
griesemer opened this issue Nov 1, 2016 · 5 comments
Closed

go/types: export Original function (or perhaps method) #17730

griesemer opened this issue Nov 1, 2016 · 5 comments
Assignees
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Nov 1, 2016

go/types internally defines an original function that returns the original object of an alias, if so, or just the incoming object, otherwise.

This is useful externally, as well, similar to types.Underlying().

@griesemer griesemer added this to the Go1.8Maybe milestone Nov 1, 2016
@griesemer griesemer self-assigned this Nov 1, 2016
@griesemer
Copy link
Contributor Author

@griesemer griesemer commented Nov 2, 2016

Loading

@alandonovan
Copy link
Contributor

@alandonovan alandonovan commented Nov 2, 2016

I agree that this would be a useful package-level function. (We cannot add a method to Object because that would break compatibility with user-defined implementations.)

Loading

@rsc
Copy link
Contributor

@rsc rsc commented Nov 2, 2016

Adding a method to Object is OK, @alandonovan. Object has unexported methods so there are no from-scratch user-defined implementations. At most there are user-defined implementations that embed some implementation provided by the go/types package.

Loading

@alandonovan
Copy link
Contributor

@alandonovan alandonovan commented Nov 2, 2016

Ah, I forgot about that. Good point.

Loading

@griesemer
Copy link
Contributor Author

@griesemer griesemer commented Nov 4, 2016

Decision to back out current alias implementation. See #16339. Closing.

Loading

@griesemer griesemer closed this Nov 4, 2016
@golang golang locked and limited conversation to collaborators Nov 5, 2017
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