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

Enum that inherit UInt64 do not get right values #7268

Closed
bcardiff opened this issue Jan 4, 2019 · 1 comment · Fixed by #7776
Closed

Enum that inherit UInt64 do not get right values #7268

bcardiff opened this issue Jan 4, 2019 · 1 comment · Fixed by #7776
Assignees
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:semantic

Comments

@bcardiff
Copy link
Member

bcardiff commented Jan 4, 2019

The compiler uses 32 bit integer to keep the values assigned to enum members.
If the Enum is declared with UInt64 as in https://github.com/crystal-lang/crystal/blob/master/src/llvm/enums.cr#L4 the user needs to assign values explicitly.

Affected lines https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/semantic/top_level_visitor.cr#L683-L686

Extracted from #7262


$ crystal --version
Crystal 0.27.0

@bcardiff bcardiff added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:semantic labels Jan 4, 2019
@RX14 RX14 added this to the 0.27.1 milestone Jan 5, 2019
@bcardiff
Copy link
Member Author

@RX14 I think there is no need to fix this issue for 0.27.1, it has been there for a while already.

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:compiler:semantic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants