mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
17 lines
229 B
V
17 lines
229 B
V
fn test_anon_functions_can_have_loops_with_breaks() {
|
|
mut res := 123
|
|
for true {
|
|
x := fn () int {
|
|
for x in 0 .. 10 {
|
|
println(x)
|
|
break
|
|
}
|
|
return 3
|
|
}()
|
|
println('${x}')
|
|
res = x
|
|
break
|
|
}
|
|
assert res == 3
|
|
}
|