From: Jérémie Astor Date: Fri, 15 Apr 2022 00:47:43 +0000 (+0200) Subject: :art: Improve => now err message (thanks jackojc) X-Git-Tag: nightly~312 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7fa81d98387a9b51fd263e6ecf9cad63a4067af8;p=gwion.git :art: Improve => now err message (thanks jackojc) --- diff --git a/src/parse/operator.c b/src/parse/operator.c index 4d98d223..fdf03fcf 100644 --- a/src/parse/operator.c +++ b/src/parse/operator.c @@ -332,9 +332,13 @@ ANN Type op_check(const Env env, struct Op_Import *opi) { if (opi->op == insert_symbol(env->gwion->st, "@func_check")) return NULL; if (opi->op == insert_symbol(env->gwion->st, "@class_check")) return env->gwion->type[et_error]; - if (opi->op != insert_symbol(env->gwion->st, "@implicit")) + if(opi->op == insert_symbol(env->gwion->st, "=>") && !strcmp(opi->rhs->name, "@now")) { + gwerr_basic(_("no match found for operator"), "expected duration", "did you try converting to `dur`?", env->name, opi->pos, 0); + env->context->error = true; + } else if (opi->op != insert_symbol(env->gwion->st, "@implicit")) { env_err(env, opi->pos, _("%s %s %s: no match found for operator"), type_name(opi->lhs), s_name(opi->op), type_name(opi->rhs)); + } return NULL; }