From 62032c43db30357ac531baf31cb3f7e0a0ec1749 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 12 Apr 2022 14:02:52 +0300 Subject: [PATCH] ast: fix Table.rewrite_already_registered_symbol calls (they were setting sym.idx to 0) --- vlib/v/ast/table.v | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vlib/v/ast/table.v b/vlib/v/ast/table.v index 75c1d8cc14..e9d0028f1e 100644 --- a/vlib/v/ast/table.v +++ b/vlib/v/ast/table.v @@ -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