mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
parent
eaf005e29f
commit
214628a939
2 changed files with 9 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue