ast: fix Table.rewrite_already_registered_symbol calls (they were setting sym.idx to 0)
parent
9b43713ec5
commit
62032c43db
|
@ -768,6 +768,7 @@ fn (mut t Table) rewrite_already_registered_symbol(typ TypeSymbol, existing_idx
|
||||||
t.type_symbols[existing_idx] = &TypeSymbol{
|
t.type_symbols[existing_idx] = &TypeSymbol{
|
||||||
...typ
|
...typ
|
||||||
methods: existing_symbol.methods
|
methods: existing_symbol.methods
|
||||||
|
idx: existing_idx
|
||||||
}
|
}
|
||||||
return existing_idx
|
return existing_idx
|
||||||
}
|
}
|
||||||
|
@ -781,11 +782,13 @@ fn (mut t Table) rewrite_already_registered_symbol(typ TypeSymbol, existing_idx
|
||||||
*existing_symbol = &TypeSymbol{
|
*existing_symbol = &TypeSymbol{
|
||||||
...typ
|
...typ
|
||||||
kind: existing_symbol.kind
|
kind: existing_symbol.kind
|
||||||
|
idx: existing_idx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
t.type_symbols[existing_idx] = &TypeSymbol{
|
t.type_symbols[existing_idx] = &TypeSymbol{
|
||||||
...typ
|
...typ
|
||||||
|
idx: existing_idx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return existing_idx
|
return existing_idx
|
||||||
|
|
Loading…
Reference in New Issue