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

Comments

@griesemer
Copy link
Contributor

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

cc: @alandonovan

@alandonovan
Copy link
Contributor

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.)

@rsc
Copy link
Contributor

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.

@alandonovan
Copy link
Contributor

Ah, I forgot about that. Good point.

@griesemer
Copy link
Contributor Author

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

@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
Development

No branches or pull requests

4 participants