vxx2 / vlib / v / checker / tests / comptime_selector_map_copy_err.vv
20 lines · 18 sloc · 257 bytes · 777460dfd3f7cf551cb57ac9a6f29831aa85f164
Raw
1struct Item {
2 values map[string]string
3}
4
5fn process[T](val T) {
6 $for field in T.fields {
7 $if field.unaliased_typ is map[string]string {
8 values := val.$(field.name)
9 _ = values
10 }
11 }
12}
13
14fn main() {
15 process(Item{
16 values: {
17 'a': 'b'
18 }
19 })
20}
21