From 1037d3a383625acd3fa9f79e2c0646b0fea4a874 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 2 Dec 2020 23:58:06 +0100 Subject: [PATCH] checker: make missing `mut` before an argument a warning --- vlib/v/checker/checker.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index fdcb095225..bf1ccb7e9e 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -1294,7 +1294,7 @@ pub fn (mut c Checker) call_method(mut call_expr ast.CallExpr) table.Type { } else { if param.is_mut && (!arg.is_mut || param.typ.share() != arg.share) { tok := arg.share.str() - c.error('`$call_expr.name` parameter `$param.name` is `$tok`, you need to provide `$tok` e.g. `$tok arg${i + + c.warn('`$call_expr.name` parameter `$param.name` is `$tok`, you need to provide `$tok` e.g. `$tok arg${i + 1}`', arg.expr.position()) } } @@ -1566,7 +1566,7 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type { } else { if arg.is_mut && (!call_arg.is_mut || arg.typ.share() != call_arg.share) { tok := call_arg.share.str() - c.error('`$call_expr.name` parameter `$arg.name` is `$tok`, you need to provide `$tok` e.g. `$tok arg${i + + c.warn('`$call_expr.name` parameter `$arg.name` is `$tok`, you need to provide `$tok` e.g. `$tok arg${i + 1}`', call_arg.expr.position()) } }