From abdb19ef3e4561539abb89420c6cf88c2a635068 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 14 Mar 2021 22:20:52 +0100 Subject: [PATCH] :art: Update and clean --- ast | 2 +- src/parse/check.c | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ast b/ast index a3b4461d..0bcba3a1 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit a3b4461d52fedd0bde45ea51900311aec463651a +Subproject commit 0bcba3a1156c0ca3c5af5488336e5fb092ac2cf8 diff --git a/src/parse/check.c b/src/parse/check.c index c8b6643a..ed9e1218 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -545,11 +545,8 @@ ANN static void print_arg(Arg_List e) { ANN2(1) static void function_alternative(const Env env, const Type f, const Exp args, const loc_t pos){ if(env->context->error) // needed for ufcs return; - loc_header(pos, env->name); - gw_err(_("argument type(s) do not match for function {+/}%s{0}.\n"), - s_name(f->info->func->def->base->xid)); - loc_err(pos, env->name); - gw_err("\nalternative:\n"); + gwerr_basic("Argument type mismatch", "call site", "valid alternatives:", + env->name, pos, 0); Func up = f->info->func; do { gw_err(" {-}(%s){0} ", up->name); @@ -731,7 +728,7 @@ ANN Type check_exp_call1(const Env env, Exp_Call *const exp) { exp->func->type = func->value_ref->type; return func->def->base->ret_type; } - function_alternative(env, exp->func->type, exp->args, exp_self(exp)->pos); + function_alternative(env, exp->func->type, exp->args, exp->args->pos); return NULL; } @@ -778,16 +775,14 @@ ANN static m_bool predefined_call(const Env env, const Type t, const loc_t pos) t->name, str); free_mstr(env->gwion->mp, str); if(tflag(t, tflag_typedef)) { - loc_header(t->info->func->def->pos, env->name); - gw_err(_("from definition:\n")); - loc_err(t->info->func->def->pos, env->name); + gwerr_secondary("from definition:", + env->name, t->info->func->def->pos); } return GW_ERROR; } ANN static Type check_exp_call(const Env env, Exp_Call* exp) { if(exp->tmpl) { -// CHECK_BO(func_check(env, exp)) DECL_BO(const m_bool, ret, = func_check(env, exp)) if(!ret) return exp_self(exp)->type; -- 2.43.0