v2 / vlib / v / parser / tests / embedded_struct_attribute_err.vv
14 lines · 11 sloc · 185 bytes · 396d46d9ca41a37b8654d17d9f5ab5e2f70c8171
Raw
1import json
2
3struct Size {
4 width int
5}
6
7struct Button {
8 Size [json: size] // fmt removes [json: size]
9}
10
11fn main() {
12 a := Button{}
13 println(json.encode(a)) // {"size":{"width":0}}
14}
15