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

Fix Enum#to_s for private enum #9126

Merged
merged 5 commits into from
Apr 22, 2020

Conversation

straight-shoota
Copy link
Member

Enum#to_s no longer relies on constant lookup which would fail if the type is declared with private visibility.

Resolves #9044

Enum#to_s no longer relies on constant lookup which would fail if the type is
declared with private visibility.
@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib labels Apr 18, 2020
jhass
jhass previously approved these changes Apr 18, 2020
src/enum.cr Outdated Show resolved Hide resolved
Copy link
Member

@asterite asterite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also fix to_s(io)? It's similar. (with tests 🙏 )

@bcardiff
Copy link
Member

There are other places in enum.cr that uses {{@type}}::{{member}}. I guess those should be changed also, but is still a workaround of not been able to pass private types to macros.

src/enum.cr Show resolved Hide resolved
src/enum.cr Outdated Show resolved Hide resolved
RX14
RX14 previously approved these changes Apr 20, 2020
jhass
jhass previously approved these changes Apr 21, 2020
@asterite
Copy link
Member

CI is red

@straight-shoota straight-shoota dismissed stale reviews from jhass and RX14 via 6bf1dba April 21, 2020 11:17
@bcardiff bcardiff added this to the 0.35.0 milestone Apr 21, 2020
@bcardiff bcardiff dismissed asterite’s stale review April 22, 2020 14:51

Changes requested were addressed

@bcardiff bcardiff merged commit 25f51f6 into crystal-lang:master Apr 22, 2020
@straight-shoota straight-shoota deleted the fix/enum-to_s branch April 22, 2020 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants