From f062337344dbce67846f73d209c6edcbb23621ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 11 May 2020 01:31:45 +0200 Subject: [PATCH] :art: Check inferabity of base type --- src/parse/check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) } -- 2.43.0