v2 / vlib / v / tests / fns / fn_call_interface_args_test.v
12 lines · 10 sloc · 250 bytes · 1411c2710b03c53fa0de08d39c656d98721783f6
Raw
1interface Foo {}
2
3fn has_interface_args(mut a Foo, b &Foo, c Foo) {
4 assert a == unsafe { &Foo(1) }
5 assert b == unsafe { &Foo(1) }
6 assert c == Foo(1)
7}
8
9fn test_fn_call_interface_args() {
10 mut arg := Foo(1)
11 has_interface_args(mut arg, arg, arg)
12}
13