cgen: fix << for `mut a []Type` args

pull/5607/head
Delyan Angelov 2020-07-01 09:21:50 +03:00
parent 78e1127d99
commit cfd71560fa
1 changed files with 4 additions and 1 deletions

View File

@ -1857,7 +1857,10 @@ fn (mut g Gen) infix_expr(node ast.InfixExpr) {
} else {
// push a single element
elem_type_str := g.typ(info.elem_type)
g.write('array_push(&')
g.write('array_push(')
if !left_type.is_ptr() {
g.write('&')
}
g.expr(node.left)
g.write(', _MOV(($elem_type_str[]){ ')
elem_sym := g.table.get_type_symbol(info.elem_type)