From: Jérémie Astor Date: Sun, 10 May 2020 23:31:45 +0000 (+0200) Subject: :art: Check inferabity of base type X-Git-Tag: nightly~1580 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=f062337344dbce67846f73d209c6edcbb23621ae;p=gwion.git :art: Check inferabity of base type --- diff --git a/src/parse/check.c b/src/parse/check.c index 56fbd646..d51081d3 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -159,13 +159,13 @@ ANN Type check_exp_decl(const Env env, const Exp_Decl* decl) { clear_decl(env, decl); CHECK_BO(scan1_exp(env, exp_self(decl))) CHECK_BO(scan2_exp(env, exp_self(decl))) - if(GET_FLAG(decl->type, infer)) - ERR_O(td_pos(decl->td), _("can't infer type.")); } if(!decl->type) ERR_O(td_pos(decl->td), _("can't find type")); { const Type t = get_type(decl->type); + if(GET_FLAG(t, infer)) + ERR_O(td_pos(decl->td), _("can't infer type.")); if(!GET_FLAG(t, check) && t->e->def) CHECK_BO(ensure_check(env, t)) }