mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix map_in mut (#5638)
This commit is contained in:
@ -301,3 +301,15 @@ fn test_map_keys_to_array() {
|
||||
println(sarr)
|
||||
assert sarr == "['a', 'c']"
|
||||
}
|
||||
|
||||
fn map_in_mut(mut m map[string]int) {
|
||||
if 'one' in m {
|
||||
m['one'] = 2
|
||||
}
|
||||
}
|
||||
|
||||
fn test_map_in_mut() {
|
||||
mut m := {'one': 1}
|
||||
map_in_mut(mut m)
|
||||
assert m['one'] == 2
|
||||
}
|
||||
|
Reference in New Issue
Block a user