checker: handle `println()`
parent
b5b8fdaeda
commit
7a5a4df4c6
|
@ -838,7 +838,7 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type {
|
||||||
return f.return_type
|
return f.return_type
|
||||||
}
|
}
|
||||||
// println can print anything
|
// println can print anything
|
||||||
if fn_name == 'println' || fn_name == 'print' {
|
if (fn_name == 'println' || fn_name == 'print') && call_expr.args.len > 0 {
|
||||||
c.expected_type = table.string_type
|
c.expected_type = table.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)
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue