From b4310d08333fcb9ae4f3e4bf1e0e5fc6599ada4e Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 31 Aug 2022 16:00:34 +0200 Subject: def x = expr -> defmacro x = expr, def const -> def --- src/fold.cff | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/fold.cff') diff --git a/src/fold.cff b/src/fold.cff index 8814d32..be08256 100644 --- a/src/fold.cff +++ b/src/fold.cff @@ -24,16 +24,18 @@ fn numcast(ex *Expr, to *const Type) void { *f = *f; case from->is(:Bool); iu.i = *b ? 1 : 0; - case from->is(:Int) and to == ty_u8; + case from->is(:Int) and to == ty_i8; iu.i = as(i8)iu.i; case from->is(:Int) and to == ty_u8; iu.i = as(u8)iu.i; case from->is(:Int) and to == ty_i16; iu.i = as(i16)iu.i; case from->is(:Int) and to == ty_u16; - iu.i = as(u8)iu.i; + iu.i = as(u16)iu.i; case from->is(:Int) and to == ty_i32; iu.i = as(i32)iu.i; + case from->is(:Int) and to == ty_u32; + iu.i = as(u32)iu.i; case from->is(:Int) and to == ty_i64; iu.i = as(i64)iu.i; case from->is(:Int) and to == ty_u64; -- cgit v1.2.3