mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: same fix for array.insert
This commit is contained in:
@@ -5040,7 +5040,13 @@ fn (mut g Gen) gen_array_insert(node ast.CallExpr) {
|
|||||||
g.write('.len)')
|
g.write('.len)')
|
||||||
} else {
|
} else {
|
||||||
g.write(', &($elem_type_str[]){')
|
g.write(', &($elem_type_str[]){')
|
||||||
|
if left_info.elem_type == table.string_type {
|
||||||
|
g.write('string_clone(')
|
||||||
|
}
|
||||||
g.expr(node.args[1].expr)
|
g.expr(node.args[1].expr)
|
||||||
|
if left_info.elem_type == table.string_type {
|
||||||
|
g.write(')')
|
||||||
|
}
|
||||||
g.write('})')
|
g.write('})')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user