1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.parser: fix xxx.fncall(map{x: []string{}}) treatment as []xxx.string{}

This commit is contained in:
Delyan Angelov 2021-03-18 11:07:25 +02:00
parent 4e62bc0b81
commit db46ad5481
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -25,9 +25,15 @@ pub fn (mut p Parser) call_expr(language table.Language, mod string) ast.CallExp
mut or_kind := ast.OrKind.absent
if fn_name == 'json.decode' {
p.expecting_type = true // Makes name_expr() parse the type `User` in `json.decode(User, txt)`
p.expr_mod = ''
or_kind = .block
}
//
old_expr_mod := p.expr_mod
defer {
p.expr_mod = old_expr_mod
}
p.expr_mod = ''
//
mut generic_types := []table.Type{}
mut generic_list_pos := p.tok.position()
if p.tok.kind == .lt {