mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: use gen.expr for default fixed array init expr. closes #7411
This commit is contained in:
parent
829334890b
commit
bbcaaa1232
@ -1967,10 +1967,12 @@ fn (mut g Gen) gen_assign_stmt(assign_stmt ast.AssignStmt) {
|
||||
if is_fixed_array_init && !has_val {
|
||||
if val is ast.ArrayInit {
|
||||
if val.has_default {
|
||||
g.write('{$val.default_expr')
|
||||
g.write('{')
|
||||
g.expr(val.default_expr)
|
||||
info := right_sym.info as table.ArrayFixed
|
||||
for _ in 1 .. info.size {
|
||||
g.write(', $val.default_expr')
|
||||
g.write(', ')
|
||||
g.expr(val.default_expr)
|
||||
}
|
||||
g.write('}')
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user