v2 / vlib / v / debug / tests / mut_arg.vv
18 lines · 15 sloc · 167 bytes · 9f6448e30e3af6fddc4998652d27ad4e060fe2f3
Raw
1struct Test {
2 a string
3}
4
5fn (t &Test) str() string {
6 return t.a
7}
8
9fn test_mut(mut b Test) {
10 $dbg;
11}
12
13fn main() {
14 mut a := Test{
15 a: 'foo'
16 }
17 test_mut(mut a)
18}
19