cgen: use gen.expr for default fixed array init expr. closes #7411
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 is_fixed_array_init && !has_val {
|
||||||
if val is ast.ArrayInit {
|
if val is ast.ArrayInit {
|
||||||
if val.has_default {
|
if val.has_default {
|
||||||
g.write('{$val.default_expr')
|
g.write('{')
|
||||||
|
g.expr(val.default_expr)
|
||||||
info := right_sym.info as table.ArrayFixed
|
info := right_sym.info as table.ArrayFixed
|
||||||
for _ in 1 .. info.size {
|
for _ in 1 .. info.size {
|
||||||
g.write(', $val.default_expr')
|
g.write(', ')
|
||||||
|
g.expr(val.default_expr)
|
||||||
}
|
}
|
||||||
g.write('}')
|
g.write('}')
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue