mirror of
https://github.com/vlang/v.git
synced 2025-09-24 04:48:28 -04:00
parent
eaf005e29f
commit
214628a939
@ -1183,6 +1183,9 @@ pub fn (mut w Walker) mark_by_sym(isym ast.TypeSymbol) {
|
||||
w.mark_by_type(isym.info.key_type)
|
||||
w.mark_by_type(isym.info.value_type)
|
||||
w.features.used_maps++
|
||||
if isym.info.value_type.has_flag(.option) {
|
||||
w.used_option++
|
||||
}
|
||||
}
|
||||
ast.Alias {
|
||||
w.mark_by_type(isym.info.parent_type)
|
||||
|
6
vlib/v/tests/options/option_map_val_test.v
Normal file
6
vlib/v/tests/options/option_map_val_test.v
Normal file
@ -0,0 +1,6 @@
|
||||
fn test_main() {
|
||||
mut m := map[int]?u32{}
|
||||
if c := m[0] {
|
||||
println('c: ${c} not none!')
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user