v2 / vlib / v / checker / tests / chan_args.vv
15 lines · 15 sloc · 260 bytes · 8ab0d42b5ffa903085db0fd60f2ad1877e64013a
Raw
1fn main() {
2 ch := chan f64{cap: 5}
3 a := 2
4 _ := ch.try_push(a)
5 _ := ch.try_push(2.5)
6 b := 2.5
7 _ := ch.try_pop(b)
8 // this should work:
9 _ := ch.try_push(b)
10 mut c := 7
11 _ := ch.try_pop(mut c)
12 mut x := 12.5
13 // this should work:
14 _ := ch.try_pop(mut x)
15}
16