| 1 | interface TheInterface { |
| 2 | mut: |
| 3 | an_interface() ? |
| 4 | } |
| 5 | |
| 6 | struct Implementation { |
| 7 | } |
| 8 | |
| 9 | fn (mut i Implementation) an_interface() ? { |
| 10 | return |
| 11 | } |
| 12 | |
| 13 | fn maker() ?TheInterface { |
| 14 | inner := Implementation{} |
| 15 | return inner |
| 16 | } |
| 17 | |
| 18 | fn do(mut inter TheInterface) string { |
| 19 | return 'ok' |
| 20 | } |
| 21 | |
| 22 | fn test_fn_mut_arg_of_interface() { |
| 23 | mut inner := maker()? |
| 24 | ret := do(mut inner) |
| 25 | println(ret) |
| 26 | assert ret == 'ok' |
| 27 | } |
| 28 |