mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fix second use of gloabl ident
This commit is contained in:
parent
4a7ec90bef
commit
e38a221dc3
@ -1984,16 +1984,13 @@ pub fn (mut c Checker) ident(mut ident ast.Ident) table.Type {
|
|||||||
return table.void_type
|
return table.void_type
|
||||||
}
|
}
|
||||||
// second use
|
// second use
|
||||||
if ident.kind == .variable {
|
if ident.kind in [.constant, .global, .variable] {
|
||||||
info := ident.info as ast.IdentVar
|
info := ident.info as ast.IdentVar
|
||||||
// if info.typ == table.t_type {
|
// if info.typ == table.t_type {
|
||||||
// Got a var with type T, return current generic type
|
// Got a var with type T, return current generic type
|
||||||
// return c.cur_generic_type
|
// return c.cur_generic_type
|
||||||
// }
|
// }
|
||||||
return info.typ
|
return info.typ
|
||||||
} else if ident.kind == .constant {
|
|
||||||
info := ident.info as ast.IdentVar
|
|
||||||
return info.typ
|
|
||||||
} else if ident.kind == .function {
|
} else if ident.kind == .function {
|
||||||
info := ident.info as ast.IdentFn
|
info := ident.info as ast.IdentFn
|
||||||
return info.typ
|
return info.typ
|
||||||
|
Loading…
Reference in New Issue
Block a user