diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index dfca62f9fc..1feb19a7d6 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -217,6 +217,7 @@ pub fn (c mut Checker) call_expr(call_expr mut ast.CallExpr) table.Type { } // println can print anything if fn_name == 'println' { + c.expr(call_expr.args[0]) return f.return_type } for i, arg_expr in call_expr.args { diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index 8eb9ae0cb2..2f5f26119d 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -484,6 +484,7 @@ fn (g mut Gen) expr(node ast.Expr) { g.expr(it.left) g.write(', ') g.expr(it.right) + g.write(')') } else { // if it.op == .dot { diff --git a/vlib/v/gen/tests/1.c b/vlib/v/gen/tests/1.c index 825c9a99c5..850b3cc2db 100644 --- a/vlib/v/gen/tests/1.c +++ b/vlib/v/gen/tests/1.c @@ -89,7 +89,7 @@ i < 10; i++) { bool b3 = get_bool() || true; int f = array_int_first(nums); string d = tos3("d"); - println(string_add(s + d)); + println(string_add(s, d)); } void User_inc_age(User u, int n) {