Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
parser
/
tests
/
embedded_struct_attribute_err.vv
14
lines
·
11
sloc
·
185 bytes
·
396d46d9ca41a37b8654d17d9f5ab5e2f70c8171
Raw
1
import json
2
3
struct Size {
4
width int
5
}
6
7
struct Button {
8
Size [json: size] // fmt removes [json: size]
9
}
10
11
fn main() {
12
a := Button{}
13
println(json.encode(a)) // {"size":{"width":0}}
14
}
15