You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnsome_fn(text string) {
mutsome_map:=map[string]stringdump(some_map)
key:=''found:= some_map[key] or {
key2:=''// THIS WORKS// if key2 in some_map {// _ := if some_map[key2] == key {// 0// } else {// panic('err')// }// } else {// some_map[key2] = key// 0// }// WHILE THIS IS BROKENif key2in some_map {
if some_map[key2] == key {
} else {
panic('err')
}
} else {
some_map[key2] = key
}
key2
}
dump(found)
}
fnmain() {
some_fn('abc abc')
}
Expected Behavior
code compiles and runs
Current Behavior
x.v:23:4: error: `if` expression requires an expression as the last statement of every branch
21 | // WHILE THIS IS BROKEN
22 | if key2 in some_map {
23 | if some_map[key2] == key {
| ~~~~~~~~~~~~~~~~~~~~~~~~
24 | } else {
25 | panic('err')
x.v:23:4: error: the final expression in `if` or `match`, must have a value of a non-void type
21 | // WHILE THIS IS BROKEN
22 | if key2 in some_map {
23 | if some_map[key2] == key {
| ~~
24 | } else {
25 | panic('err')
x.v:28:19: error: `if` expression requires an expression as the last statement of every branch
26 | }
27 | } else {
28 | some_map[key2] = key
| ^
29 | }
30 |
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.11
Environment details (OS name and version, etc.)
|V full version |V 0.4.11 487feb9
|V last modified time|2025-09-01 17:45:42
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Describe the bug
Nested
ifwrongly expects expression value.Reproduction Steps
Run code below
Expected Behavior
code compiles and runs
Current Behavior
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.11
Environment details (OS name and version, etc.)
|V full version |V 0.4.11 487feb9
|V last modified time|2025-09-01 17:45:42
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.