From 43942057a477495c6d462a07fe8e83e0fad7cf89 Mon Sep 17 00:00:00 2001 From: Vasilis Katsifolis Date: Sun, 13 Sep 2020 16:19:53 +0300 Subject: [PATCH] checker: fix a type check that caused a C error #6238 (#6358) --- vlib/v/checker/checker.v | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index bcb8a7fa7e..48ee38158a 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -1383,9 +1383,12 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type { */ if !c.check_types(typ, arg.typ) { // str method, allow type with str method if fn arg is string - if arg_typ_sym.kind == .string && typ_sym.has_method('str') { - continue - } + // Passing an int or a string array produces a c error here + // Deleting this condition results in propper V error messages + // if arg_typ_sym.kind == .string && typ_sym.has_method('str') { + // continue + // } + if typ_sym.kind == .void && arg_typ_sym.kind == .string { continue }