mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
array: fix initialization of empty fixed size arrays
This commit is contained in:
@ -59,7 +59,9 @@ fn (p mut Parser) gen_var_decl(name string, is_static bool) string {
|
||||
initializer := p.cgen.cur_line.right(pos)
|
||||
if initializer.len > 0 {
|
||||
p.cgen.resetln(' = {' + initializer.all_after('{') )
|
||||
}
|
||||
} else if initializer.len == 0 {
|
||||
p.cgen.resetln(' = { 0 }')
|
||||
}
|
||||
}
|
||||
|
||||
if is_static {
|
||||
|
Reference in New Issue
Block a user