vxx2 / vlib / v / checker / tests / unsafe_method_as_field.out
7 lines · 7 sloc · 375 bytes · 769e9147c321cc0e701112fe748b20032b8176c3
Raw
1vlib/v/checker/tests/unsafe_method_as_field.vv:23:7: error: method `Foo.ref` cannot be used as a variable outside `unsafe` blocks as its receiver might refer to an object stored on stack. Consider declaring `Foo` as `@[heap]`.
2 21 | f := Foo{}
3 22 | _ := f.no_ref // no error
4 23 | _ := f.ref // error
5 | ~~~~~
6 24 |
7 25 | b := Bar{}
8