From 7fa81d98387a9b51fd263e6ecf9cad63a4067af8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 15 Apr 2022 02:47:43 +0200 Subject: [PATCH] :art: Improve => now err message (thanks jackojc) --- src/parse/operator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.43.0