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

ast: fix Table.rewrite_already_registered_symbol calls (they were setting sym.idx to 0)

This commit is contained in:
Delyan Angelov 2022-04-12 14:02:52 +03:00
parent 9b43713ec5
commit 62032c43db
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -768,6 +768,7 @@ fn (mut t Table) rewrite_already_registered_symbol(typ TypeSymbol, existing_idx
t.type_symbols[existing_idx] = &TypeSymbol{
...typ
methods: existing_symbol.methods
idx: existing_idx
}
return existing_idx
}
@ -781,11 +782,13 @@ fn (mut t Table) rewrite_already_registered_symbol(typ TypeSymbol, existing_idx
*existing_symbol = &TypeSymbol{
...typ
kind: existing_symbol.kind
idx: existing_idx
}
}
} else {
t.type_symbols[existing_idx] = &TypeSymbol{
...typ
idx: existing_idx
}
}
return existing_idx