Gitly
English
Русский
Español
日本語
中文
Português
Pricing
Log in
Register
v2
/
vlib
/
v
/
checker
/
tests
/
map_init_invalid_update.vv
22
lines
·
21
sloc
·
232 bytes
·
c4b80369702d22bd05ad3bdf58ce564b2f0eff4e
Raw
1
struct Foo {
2
x int
3
}
4
5
fn main() {
6
foo := 'foo is a string'
7
a := {
8
...foo // not a map
9
'a': 5
10
'b': 6
11
}
12
println(a)
13
b := {
14
...(a.clone()) // ok
15
'c': 99
16
}
17
println(b)
18
c := {
19
...Foo{9} // also not ok
20
}
21
println(c)
22
}
23