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 flags assigned values when a member has value 0 #5954

Merged
merged 1 commit into from Apr 28, 2018

Conversation

bew
Copy link
Contributor

@bew bew commented Apr 17, 2018

Fixes #5767

Given this enum flags:

@[Flags]
enum EventMask
  NoEvent = 0

  KeyPress
  ButtonPress
  EnterWindow
  # ...
end

Before:

EventMask::NoEvent # => None
EventMask::EnterWindow # => None
EventMask::EnterWindow.value # => 0

After:

EventMask::NoEvent # => None
EventMask::EnterWindow # => EnterWindow
EventMask::EnterWindow.value # => 4

@asterite asterite requested a review from RX14 April 28, 2018 13:07
@RX14 RX14 added this to the Next milestone Apr 28, 2018
@RX14 RX14 merged commit 346e591 into crystal-lang:master Apr 28, 2018
@bew bew deleted the fix-enum-flag-0 branch April 28, 2018 16:35
straight-shoota added a commit to straight-shoota/crystal that referenced this pull request Jun 4, 2018
chris-huxtable pushed a commit to chris-huxtable/crystal that referenced this pull request Jun 6, 2018
straight-shoota added a commit to straight-shoota/crystal that referenced this pull request Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants