Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
generics
/
generic_function_error_propagation_test.v
12
lines
·
10
sloc
·
233 bytes
·
7b22bae12ea108ee51a457a9dd99935ad0c88dc1
Raw
1
import
rand
2
3
type
Condition =
fn
() bool
4
5
fn
test_generic_function_error_propagation() {
6
mut
list := []Condition{}
7
list = [
fn
() bool {
8
return
true
9
}]
10
println(rand.element[Condition](list)
or
{ panic(
'Err'
) })
11
println(list)
12
}
13