Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Dec 25, 2024
1 parent 020c8ef commit ea4435e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -7285,7 +7285,11 @@ fn (mut g Gen) type_default_impl(typ_ ast.Type, decode_sumtype bool) string {
&& field_sym.info.is_empty_struct() {
'{EMPTY_STRUCT_INITIALIZATION}'
} else if field_sym.kind == .sum_type {
g.type_default_sumtype(field.typ, field_sym)
if decode_sumtype {
g.type_default_sumtype(field.typ, field_sym)
} else {
'{0}'
}
} else {
g.type_default(field.typ)
}
Expand Down

0 comments on commit ea4435e

Please sign in to comment.