aboutsummaryrefslogtreecommitdiff
path: root/src/type.cff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-19 16:45:10 +0200
committerlemon <lsof@mailbox.org>2022-08-19 16:45:10 +0200
commita9e8fe82c8c2e6bf15df0cae861d163f668e9a5a (patch)
treef2207bcf53d4fa107912895bc550262cda7f8596 /src/type.cff
parent80f5dca7aa8c9a7f3bf467f9ae2bdc1eae0e9a2b (diff)
change enum backing type
Diffstat (limited to 'src/type.cff')
-rw-r--r--src/type.cff3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/type.cff b/src/type.cff
index b0cb259..a07ea0d 100644
--- a/src/type.cff
+++ b/src/type.cff
@@ -208,6 +208,9 @@ extern fn mkslicetype(child *const Type) *const Type {
fn numtype2rank(ty *const Type) int {
ty = unconstify(ty);
switch {
+ case ty->is(:Enum);
+ assert(ty.u.Enum.lax, "lax");
+ return numtype2rank(ty.u.Enum.intty);
case ty->is(:Int) and (ty == ty_int or ty.size < ty_int.size);
return 0;
case ty == ty_uint; return 1;