From: Jérémie Astor Date: Mon, 13 Apr 2020 21:55:01 +0000 (+0200) Subject: :bug: Fix ternary expression X-Git-Tag: nightly~1691 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=c45b4642cc84109433f9d2a0da2a0b782392ddcd;p=gwion.git :bug: Fix ternary expression --- 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; }