1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/tests/go_call_generic_fn_test.v
2021-01-13 17:35:50 +02:00

15 lines
252 B
V

fn test<T>(c chan int, s T) {
println('hi from generic fn test, T: ' + typeof(s).name)
println('s: $s')
assert true
c <- 123
}
fn test_go_generic_fn() {
mut c := chan int{}
go test<string>(c, 'abcd')
x := <-c
assert x == 123
println('bye')
}