}
#define check_flow(emit, b) _flow(emit, b, 1)
-ANN static Type check_exp_if(const Env env, const Exp_If *exp_if) {
- const Exp e = exp_if->if_exp ?: exp_if->cond;
+ANN static Type check_exp_if(const Env env, Exp_If *const exp_if) {
+ if(!exp_if->if_exp) {
+ const Exp e = exp_if->if_exp = cpy_exp(env->gwion->mp, exp_if->cond);
+ scan1_exp(env, e);
+ scan2_exp(env, e);
+ }
DECL_OO(const Type, cond, = check_flow(env, exp_if->cond));
- DECL_OO(const Type, if_exp,
- = (exp_if->if_exp ? check_exp(env, exp_if->if_exp) : cond));
+ DECL_OO(const Type, if_exp, = check_exp(env, exp_if->if_exp));
DECL_OO(const Type, else_exp, = check_exp(env, exp_if->else_exp));
- const uint meta = exp_getmeta(e) || exp_getmeta(exp_if->else_exp);
+ const uint meta = exp_getmeta(exp_if->if_exp) || exp_getmeta(exp_if->else_exp);
exp_setmeta(exp_self(exp_if), meta);
const Type ret = find_common_anc(if_exp, else_exp);
if (!ret)