Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
checker
/
tests
/
assign_immutable_reference_var_err.vv
16
lines
·
14
sloc
·
131 bytes
·
757929392e0e7a75fc1272116460981e589737d5
Raw
1
@[heap]
2
struct Foo {
3
mut:
4
value int
5
}
6
7
fn y(x &Foo) {
8
mut m := x
9
m.value = 42
10
}
11
12
fn main() {
13
x := Foo{123}
14
y(x)
15
println(x)
16
}
17