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

pull/9359/head
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
1 changed files with 7 additions and 1 deletions

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 {