From a9e8fe82c8c2e6bf15df0cae861d163f668e9a5a Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 19 Aug 2022 16:45:10 +0200 Subject: change enum backing type --- src/type.cff | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/type.cff') 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; -- cgit v1.2.3