mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v2: fix map initialization
This commit is contained in:
parent
16528b12fa
commit
5b08f307c8
@ -582,7 +582,11 @@ pub fn (p mut Parser) name_expr() ast.Expr {
|
|||||||
// `map[string]int` initialization
|
// `map[string]int` initialization
|
||||||
if p.tok.lit == 'map' && p.peek_tok.kind == .lsbr {
|
if p.tok.lit == 'map' && p.peek_tok.kind == .lsbr {
|
||||||
map_type := p.parse_map_type()
|
map_type := p.parse_map_type()
|
||||||
return node
|
map_type_sym := p.table.get_type_symbol(map_type)
|
||||||
|
return ast.TypeName{
|
||||||
|
name: map_type_sym.name
|
||||||
|
typ: map_type
|
||||||
|
}
|
||||||
}
|
}
|
||||||
known_var := p.scope.known_var(p.tok.lit)
|
known_var := p.scope.known_var(p.tok.lit)
|
||||||
if p.peek_tok.kind == .dot && !known_var && (is_c || p.known_import(p.tok.lit) || p.mod.all_after('.') == p.tok.lit) {
|
if p.peek_tok.kind == .dot && !known_var && (is_c || p.known_import(p.tok.lit) || p.mod.all_after('.') == p.tok.lit) {
|
||||||
|
Loading…
Reference in New Issue
Block a user