From 9bc1cb5d9199f21e259f17aac1838f98cc69897a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sat, 7 Aug 2021 03:33:41 +0200 Subject: [PATCH] :bug: Fix array concat emission (simplify) --- src/lib/array.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/array.c b/src/lib/array.c index cba963e0..c8102fd9 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -129,8 +129,7 @@ static OP_CHECK(opck_array_at) { } ANN static inline bool shift_match(const Type base, const Type more) { - return isa(more, base) > 0 && - get_depth(base) == get_depth(more); + return get_depth(base) == get_depth(more); } ANN static Type check_array_shift(const Env env, const Exp a, const Exp b, @@ -139,7 +138,7 @@ ANN static Type check_array_shift(const Env env, const Exp a, const Exp b, b->type->array_depth > 1) return a->type;*/ ARRAY_OPCK(a, b, pos) - if (a->type->array_depth == b->type->array_depth + 1) + if (get_depth(a->type) == get_depth(b->type) + 1) return a->type; else if (shift_match(a->type, b->type)) return a->type; -- 2.43.0