v2 / vlib / v / tests / generics / generic_alias_callback_test.v
15 lines · 12 sloc · 153 bytes · 42777f0125261bf0fe7934b3d053f6c21ba2cc46
Raw
1struct Foo[T] {
2 val T
3}
4
5type Bar[T] = fn (T) bool
6
7fn t[T](val T) {
8 _ := Bar[T](fn [T](a T) bool {
9 return true
10 })
11}
12
13fn test_main() {
14 t[int](1)
15}
16