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
/Users/adamoates/Documents/v_tests/test.v:4:4: error: the final expression in `if` or `match`, must have a value of a non-void type
2 | _ := foo() or {
3 | if err.code() == 1 {
4 | println('code 1')
| ~~~~~~~~~~~~~~~~~
5 | } else {
6 | println('code other')
/Users/adamoates/Documents/v_tests/test.v:6:4: error: the final expression in `if` or `match`, must have a value of a non-void type
4 | println('code 1')
5 | } else {
6 | println('code other')
| ~~~~~~~~~~~~~~~~~~~~~
7 | }
8 | return
What did you expect to see?
Expected code to compile and print "code other". No value is necessary since we return at the end of the or block. If you remove the else section it compiles fine with just the if statement.
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.
The text was updated successfully, but these errors were encountered:
V version: V 0.4.9 0c9d076, press to see full `v doctor` output
What did you do?
./v -g -o vdbg cmd/v && ./vdbg /Users/adamoates/Documents/v_tests/test.v && /Users/adamoates/Documents/v_tests/test
What did you see?
What did you expect to see?
Expected code to compile and print "code other". No value is necessary since we return at the end of the or block. If you remove the else section it compiles fine with just the if statement.
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.
The text was updated successfully, but these errors were encountered: