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
V full version: V 0.4.3 5306469.10d738c
OS: windows, Microsoft Windows 10 Pro v19045 64-bit
Processor: 20 cpus, 64bit, little endian,
getwd: C:\Users\user\Desktop\Code\leaflang
vexe: C:\Users\user\Desktop\Code\v\v.exe
vexe mtime: 2024-01-06 12:34:25
vroot: OK, value: C:\Users\user\Desktop\Code\v
VMODULES: OK, value: C:\Users\user\.vmodules
VTMP: OK, value: C:\Users\user\AppData\Local\Temp\v_0
Git version: git version 2.42.0.windows.1
Git vroot status: weekly.2024.01.test2-7-g10d738c7
.git/config present: true
CC version: Error: 'cc' is not recognized as an internal or external command,
operable program or batch file.
thirdparty/tcc status: thirdparty-windows-amd64 a39eb79b
What did you do? v -g -o vdbg cmd/v && vdbg test.v
fnmain() {
x:=5f:=ifx==5 { |x| x -5 } else { |x| x }
println(f(x))
}
What did you expect to see?
0 in stdout
What did you see instead?
test.v:3:19: error: a lambda expression was used, but `void` was expected
1 | fn main() {
2 | x := 5
3 | f := if x == 5 { |x| x - 5 } else { |x| x }
| ^
4 | println(f(x))
5 | }
test.v:3:19: error: a lambda expression was used, but `none` was expected
1 | fn main() {
2 | x := 5
3 | f := if x == 5 { |x| x - 5 } else { |x| x }
| ^
4 | println(f(x))
5 | }
test.v:3:19: error: the final expression in `if` or `match`, must have a value of a non-void type
1 | fn main() {
2 | x := 5
3 | f := if x == 5 { |x| x - 5 } else { |x| x }
| ^
4 | println(f(x))
5 | }
test.v:3:4: error: assignment mismatch: 1 variable(s) 0 value(s)
1 | fn main() {
2 | x := 5
3 | f := if x == 5 { |x| x - 5 } else { |x| x }
| ~~
4 | println(f(x))
5 | }
test.v:3:19: error: a lambda expression was used, but `string` was expected
1 | fn main() {
2 | x := 5
3 | f := if x == 5 { |x| x - 5 } else { |x| x }
| ^
4 | println(f(x))
5 | }
test.v:4:10: error: unknown function: f
2 | x := 5
3 | f := if x == 5 { |x| x - 5 } else { |x| x }
4 | println(f(x))
| ~~~~
5 | }
test.v:4:2: error: `println` can not print void expressions
2 | x := 5
3 | f := if x == 5 { |x| x - 5 } else { |x| x }
4 | println(f(x))
| ~~~~~~~~~~~~~
5 | }
If the code of your project is in multiple files, try with `v .` instead of `v test.v`
V doctor:
What did you do?
v -g -o vdbg cmd/v && vdbg test.v
What did you expect to see?
0 in stdout
What did you see instead?
Example of this expression in Rust: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=60a8125c5277fb69cf22f9272f60aba7
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: