1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
d2verb
2019-07-15 19:33:18 +09:00
committed by Alexander Medvednikov
parent 0556f5fd4e
commit 916b13b286
3 changed files with 79 additions and 6 deletions

View File

@@ -2303,10 +2303,12 @@ fn (p mut Parser) map_init() string {
if !p.table.known_type(val_type) {
p.error('map init unknown type "$val_type"')
}
typ := 'map_$val_type'
p.register_map(typ)
p.gen('new_map(1, sizeof($val_type))')
p.check(.lcbr)
p.check(.rcbr)
return 'map_$val_type'
return typ
}
// [1,2,3]