1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
Delyan Angelov 2020-07-01 09:21:50 +03:00
parent 78e1127d99
commit cfd71560fa

View File

@ -1857,7 +1857,10 @@ fn (mut g Gen) infix_expr(node ast.InfixExpr) {
} else { } else {
// push a single element // push a single element
elem_type_str := g.typ(info.elem_type) 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.expr(node.left)
g.write(', _MOV(($elem_type_str[]){ ') g.write(', _MOV(($elem_type_str[]){ ')
elem_sym := g.table.get_type_symbol(info.elem_type) elem_sym := g.table.get_type_symbol(info.elem_type)