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

Mention how to get the basetype of an enum #36057

Merged
merged 2 commits into from
May 29, 2020
Merged

Mention how to get the basetype of an enum #36057

merged 2 commits into from
May 29, 2020

Conversation

ViralBShah
Copy link
Member

I feel this is sufficient to address #28778, since it is a non-standard case. The type conversion with Integer() is not specific to enums - and not necessary.

@ViralBShah ViralBShah added the docs This change adds or pertains to documentation label May 28, 2020
@ViralBShah ViralBShah mentioned this pull request May 28, 2020
@JeffBezanson
Copy link
Member

I think it would be better to mention Integer(x) than to suggest using an internal function.

@ViralBShah
Copy link
Member Author

Yes, I didn't like having the internal method there.

Just to make sure I understand - instead of having people get the BaseType and cast to it, they should use Integer on the enum value directly. And of course you can then do typeof on that to get the BaseType?

@ViralBShah ViralBShah merged commit 38a373a into master May 29, 2020
@ViralBShah ViralBShah deleted the vs/28778 branch May 29, 2020 17:04
simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 11, 2020
* Mention how to get the basetype of an enum
Fix JuliaLang#28778

* Mention Integer() instead of internal method
jmert added a commit to jmert/BitFlags.jl that referenced this pull request Sep 10, 2020
Duplicates improvement made to Base's Enums: JuliaLang/julia#36057
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants