-
Notifications
You must be signed in to change notification settings - Fork 7
Fix underlying type of enums #38
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
Conversation
a22c2fa
to
3a95e9c
Compare
ir/Enum.cpp
Outdated
s << ".toULong" << "\n"; | ||
} else { | ||
llvm::errs() << "Enum type is unsupported: " << e.type << "\n"; | ||
llvm::errs().flush(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not happen since uint64_t
is unsigned long int
6a05c15
to
de446f0
Compare
@jonas, I added types to enumerators, they used to be regular Scala types, now they are |
de446f0
to
afc18ee
Compare
afc18ee
to
728c49b
Compare
tests/samples/Enum.h
Outdated
|
||
enum bigValues { | ||
A = 10000000000, // does not fit into int | ||
B = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about also adding a negative value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point, I totally forgot about negative numbers
final val enum_days_THURSDAY: enum_days = 3.toUInt | ||
final val enum_days_FRIDAY: enum_days = 4.toUInt | ||
final val enum_days_SATURDAY: enum_days = 5.toUInt | ||
final val enum_days_SUNDAY: enum_days = 6.toUInt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue #12