diff options
| author | gingerBill <bill@gingerbill.org> | 2018-08-17 15:24:44 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-08-17 15:24:44 +0100 |
| commit | 1d0ac72e4a6851effe0a9310a26974675c177cc1 (patch) | |
| tree | f274bd0323db255a81bdfd1ce6212d32f89ea555 /src/types.cpp | |
| parent | b216e44870b1883cf3fb71994eb94f642fea43a1 (diff) | |
Disable non-comparison operations for enum (use `bit_set` for flags)
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/types.cpp b/src/types.cpp index 695187f05..92dd9d37e 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -659,42 +659,40 @@ bool is_type_named_alias(Type *t) { } bool is_type_boolean(Type *t) { - t = core_type(t); + // t = core_type(t); + t = base_type(t); if (t->kind == Type_Basic) { return (t->Basic.flags & BasicFlag_Boolean) != 0; } return false; } bool is_type_integer(Type *t) { - t = core_type(t); + // t = core_type(t); + t = base_type(t); if (t->kind == Type_Basic) { return (t->Basic.flags & BasicFlag_Integer) != 0; } return false; } bool is_type_unsigned(Type *t) { - t = core_type(t); + t = base_type(t); + // t = core_type(t); if (t->kind == Type_Basic) { return (t->Basic.flags & BasicFlag_Unsigned) != 0; } return false; } bool is_type_rune(Type *t) { - t = core_type(t); + // t = core_type(t); + t = base_type(t); if (t->kind == Type_Basic) { return (t->Basic.flags & BasicFlag_Rune) != 0; } return false; } -bool is_type_number(Type *t) { - t = core_type(t); - if (t->kind == Type_Basic) { - return (t->Basic.flags & BasicFlag_Numeric) != 0; - } - return false; -} bool is_type_numeric(Type *t) { - t = core_type(t); + // t = core_type(t); + t = base_type(t); if (t->kind == Type_Basic) { return (t->Basic.flags & BasicFlag_Numeric) != 0; } |