Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
checker
/
tests
/
array_assign_err.vv
13
lines
·
12
sloc
·
222 bytes
·
c662431cfd668be6ba3b8df36ac8e46dd2237e5b
Raw
1
struct Dumb {
2
mut:
3
v []int
4
}
5
6
fn main() {
7
a := Dumb{[1, 2, 3]}
8
mut b := a.v // I expect a compiler error
9
for _ in 0 .. 100 {
10
b << [4, 5, 6]
11
}
12
println(a) // prints [4,5,6] in this case, but I've also seen crashes
13
}
14