Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
fns
/
closure_with_fixed_array_var_test.v
16
lines
·
14
sloc
·
251 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
struct
Crasher {
2
value int
3
}
4
5
fn
crash(c [1]Crasher)
fn
() int {
6
return
fn
[c] () int {
7
println(c[0].value)
8
return
c[0].value
9
}
10
}
11
12
fn
test_closure_with_fixed_array_var() {
13
crash_fn := crash([Crasher{1}]!)
14
ret := crash_fn()
15
assert ret == 1
16
}
17