v/vlib/v/checker/tests/assign_immutable_reference_...

17 lines
130 B
V

[heap]
struct Foo {
mut:
value int
}
fn y(x &Foo) {
mut m := x
m.value = 42
}
fn main() {
x := Foo{123}
y(x)
println(x)
}