From 1e9d527d3c1e0027a23397da638111a207139663 Mon Sep 17 00:00:00 2001
From: Alexander Medvednikov <alexander@vlang.io>
Date: Fri, 26 Mar 2021 12:21:22 +0300
Subject: [PATCH] checker: fix the deref mut check

---
 vlib/v/checker/checker.v | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v
index a6fb325e27..f6eac7c134 100644
--- a/vlib/v/checker/checker.v
+++ b/vlib/v/checker/checker.v
@@ -2110,7 +2110,7 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type {
 		}
 		// Warn about automatic (de)referencing, which will be removed soon.
 		if f.language != .c && !c.inside_unsafe && typ.nr_muls() != param.typ.nr_muls()
-			&& !(call_arg.is_mut && param.is_mut)
+			&& !(call_arg.is_mut && param.is_mut) && !(!call_arg.is_mut && !param.is_mut)
 			&& param.typ !in [table.byteptr_type, table.charptr_type, table.voidptr_type] {
 			// sym := c.table.get_type_symbol(typ)
 			c.warn('automatic referencing/dereferencing is deprecated and will be removed soon (got: $typ.nr_muls() references, expected: $param.typ.nr_muls() references)',