| 1 | fn test[T](c chan int, s T) { |
| 2 | println('hi from generic fn test, T: ' + typeof(s).name) |
| 3 | println('s: ${s}') |
| 4 | assert true |
| 5 | c <- 123 |
| 6 | } |
| 7 | |
| 8 | fn test_go_generic_fn() { |
| 9 | mut c := chan int{} |
| 10 | spawn test[string](c, 'abcd') |
| 11 | x := <-c |
| 12 | assert x == 123 |
| 13 | println('bye') |
| 14 | } |
| 15 | |