From 35a19a2d1bb7605fa6ceb038b2b8afee760cd11c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 3 Oct 2024 13:46:59 -0400 Subject: Bugfix for Int*Num typechecking --- types.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types.c b/types.c index 24f64e89..b1ca4bd7 100644 --- a/types.c +++ b/types.c @@ -205,6 +205,11 @@ static PUREFUNC inline double type_max_magnitude(type_t *t) PUREFUNC precision_cmp_e compare_precision(type_t *a, type_t *b) { + if (is_int_type(a) && b->tag == NumType) + return NUM_PRECISION_LESS; + else if (a->tag == NumType && is_int_type(b)) + return NUM_PRECISION_MORE; + double a_min = type_min_magnitude(a), b_min = type_min_magnitude(b), a_max = type_max_magnitude(a), -- cgit v1.2.3