From c45b4642cc84109433f9d2a0da2a0b782392ddcd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 13 Apr 2020 23:55:01 +0200 Subject: [PATCH] :bug: Fix ternary expression --- src/parse/check.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parse/check.c b/src/parse/check.c index a15ad008..815bc5bd 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -853,6 +853,10 @@ ANN static Type check_exp_if(const Env env, const Exp_If* exp_if) { ERR_O(exp_self(exp_if)->pos, _("incompatible types '%s' and '%s' in if expression..."), if_exp->name, else_exp->name) + if(!exp_if->if_exp && isa(exp_if->cond->info->type, else_exp) < 0) + ERR_O(exp_self(exp_if)->pos, + _("condition type '%s' does not match '%s'"), + cond->name, ret->name) return ret; } -- 2.43.0