mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-17 08:34:08 +00:00
Fix bug where compiler treats uint enums as ints
This commit is contained in:
@@ -1248,6 +1248,10 @@ gb_internal bool is_type_unsigned(Type *t) {
|
||||
if (t->kind == Type_Basic) {
|
||||
return (t->Basic.flags & BasicFlag_Unsigned) != 0;
|
||||
}
|
||||
if (t->kind == Type_Enum) {
|
||||
// TODO(slowhei): Is an enum's base type guaranteed to be TypeKind::Basic? Even if its backing type is implicitly int?
|
||||
return (t->Enum.base_type->Basic.flags & BasicFlag_Unsigned) != 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
gb_internal bool is_type_integer_128bit(Type *t) {
|
||||
|
||||
Reference in New Issue
Block a user