v.checker: minor cleanup of fn_call() (#10632)

pull/10647/head
yuyi 2021-07-03 00:45:12 +08:00 committed by GitHub
parent 21512d1491
commit e4d88a5be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2498,7 +2498,7 @@ pub fn (mut c Checker) fn_call(mut call_expr ast.CallExpr) ast.Type {
c.expected_type = ast.string_type c.expected_type = ast.string_type
call_expr.args[0].typ = c.expr(call_expr.args[0].expr) call_expr.args[0].typ = c.expr(call_expr.args[0].expr)
arg := call_expr.args[0] arg := call_expr.args[0]
_ := c.check_expr_opt_call(arg.expr, arg.typ) c.check_expr_opt_call(arg.expr, arg.typ)
if arg.typ.is_void() { if arg.typ.is_void() {
c.error('`$fn_name` can not print void expressions', call_expr.pos) c.error('`$fn_name` can not print void expressions', call_expr.pos)
} else if arg.typ == ast.char_type && arg.typ.nr_muls() == 0 { } else if arg.typ == ast.char_type && arg.typ.nr_muls() == 0 {