diff --git a/vlib/v/parser/parse_type.v b/vlib/v/parser/parse_type.v index bc3fdd7289..1920997dcb 100644 --- a/vlib/v/parser/parse_type.v +++ b/vlib/v/parser/parse_type.v @@ -110,7 +110,7 @@ pub fn (p mut Parser) parse_type() table.Type { name += '.' + p.tok.lit } // `Foo` in module `mod` means `mod.Foo` - else if p.mod != 'main' { + else if p.mod != 'main' && !(name in table.builtin_type_names) { name = p.mod + '.' + name } // p.warn('get type $name') diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index dbb1d697ef..2644daaab4 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -574,7 +574,7 @@ pub fn (p mut Parser) name_expr() (ast.Expr,table.Type) { expr,_ = p.expr(0) // TODO, string(b, len) // if table.type_idx(to_typ) == table.string_type_idx && p.tok.kind == .comma { - if p.tok.kind == .comma && name == 'string' { + if p.tok.kind == .comma && table.type_idx(to_typ) == table.string_type_idx { p.check(.comma) p.expr(0) // len }