mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
parent
1ba45123ec
commit
38bfc482ba
4 changed files with 9 additions and 0 deletions
|
@ -432,6 +432,9 @@ fn (mut w Walker) expr(node_ ast.Expr) {
|
||||||
if !w.uses_array && !w.is_direct_array_access {
|
if !w.uses_array && !w.is_direct_array_access {
|
||||||
w.uses_array = true
|
w.uses_array = true
|
||||||
}
|
}
|
||||||
|
if node.elem_type.has_flag(.option) {
|
||||||
|
w.used_option++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ast.Assoc {
|
ast.Assoc {
|
||||||
w.exprs(node.exprs)
|
w.exprs(node.exprs)
|
||||||
|
|
0
vlib/v/tests/skip_unused/option_array_init.run.out
Normal file
0
vlib/v/tests/skip_unused/option_array_init.run.out
Normal file
6
vlib/v/tests/skip_unused/option_array_init.vv
Normal file
6
vlib/v/tests/skip_unused/option_array_init.vv
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
fn main() {
|
||||||
|
mut a := []?u32{len: 0xFF}
|
||||||
|
if c := a[0] {
|
||||||
|
println('c: ${c} not none!')
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue