mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v2: update parse type not to prefix builtin types with module
This commit is contained in:
parent
195f3f465b
commit
1007dd8f23
@ -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')
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user