v2 / vlib / v / gen / c / testdata / iface_method_mut_receiver.vv
21 lines · 17 sloc · 224 bytes · 2e21ccfe80e823707e7cbc7b3a3b5205c0e1d413
Raw
1interface Foo {
2mut:
3 free()
4 next() u32
5}
6
7struct Bar implements Foo {
8}
9
10fn (mut b Bar) free() {}
11
12fn (mut b Bar) next() u32 {
13 return 1
14}
15
16fn main() {
17 mut bar := Bar{}
18 mut foo := Foo(&bar)
19 foo.free()
20 _ = foo.next()
21}
22