1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: use type unresolved for unresolved consts

This commit is contained in:
hazohelet
2020-03-30 02:26:55 +09:00
committed by GitHub
parent bf9f3057da
commit ec025f2020
3 changed files with 7 additions and 4 deletions

View File

@@ -756,9 +756,9 @@ fn (p mut Parser) const_decl() {
if p.first_pass() {
p.table.register_const(name, typ, p.mod, is_pub)
}
// Check to see if this constant exists, and is void. If so, try and get the type again:
// Check to see if this constant exists, and is unresolved. If so, try and get the type again:
if my_const := p.v.table.find_const(name) {
if my_const.typ == 'void' {
if my_const.typ == 'unresolved' {
for i, v in p.v.table.consts {
if v.name == name {
p.v.table.consts[i].typ = typ