mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fix maps
This commit is contained in:
committed by
Alexander Medvednikov
parent
0556f5fd4e
commit
916b13b286
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user