cgen: fix `const x := opt() or {}` side effect interference when the consts are in different files in the same module too
parent
e275220f05
commit
b576181a66
|
@ -5833,7 +5833,9 @@ fn (mut g Gen) const_decl_init_later(mod string, name string, expr ast.Expr, typ
|
|||
}
|
||||
} else {
|
||||
if unwrap_option {
|
||||
g.init.writeln('{')
|
||||
g.init.writeln(g.expr_string_surround('\t$cname = *($styp*)', expr, '.data;'))
|
||||
g.init.writeln('}')
|
||||
} else {
|
||||
g.init.writeln(g.expr_string_surround('\t$cname = ', expr, ';'))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue