cgen: fix indent in multi_return (#5617)

pull/5620/head
yuyi 2020-07-02 17:08:27 +08:00 committed by GitHub
parent e904732554
commit c21527d3c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -2473,7 +2473,7 @@ fn (mut g Gen) return_statement(node ast.Return) {
g.expr(expr)
arg_idx++
if i < node.exprs.len - 1 {
g.write(',')
g.write(', ')
}
}
g.write('}')
@ -2482,7 +2482,9 @@ fn (mut g Gen) return_statement(node ast.Return) {
g.write('return $opt_tmp')
}
// Make sure to add our unpacks
g.insert_before_stmt(multi_unpack)
if multi_unpack.len > 0 {
g.insert_before_stmt(multi_unpack)
}
} else if node.exprs.len >= 1 {
// normal return
return_sym := g.table.get_type_symbol(node.types[0])