checker: fix second use of gloabl ident

pull/5095/head
joe-conigliaro 2020-06-10 16:59:31 +10:00
parent 4a7ec90bef
commit e38a221dc3
1 changed files with 1 additions and 4 deletions

View File

@ -1984,16 +1984,13 @@ pub fn (mut c Checker) ident(mut ident ast.Ident) table.Type {
return table.void_type
}
// second use
if ident.kind == .variable {
if ident.kind in [.constant, .global, .variable] {
info := ident.info as ast.IdentVar
// if info.typ == table.t_type {
// Got a var with type T, return current generic type
// return c.cur_generic_type
// }
return info.typ
} else if ident.kind == .constant {
info := ident.info as ast.IdentVar
return info.typ
} else if ident.kind == .function {
info := ident.info as ast.IdentFn
return info.typ