Register the local variable symbol, not its type
@@ -168,7 +168,7 @@ func (a *astBinder) visitLocalVariable(node *ast.LocalVariable) {
// Encountering a new local variable results in registering it; both to the type and symbol table.
ty := a.b.ctx.LookupType(node.Type)
sym := symbols.NewLocalVariableSym(node, ty)
- a.b.ctx.RegisterSymbol(node, ty)
+ a.b.ctx.RegisterSymbol(node, sym)
a.b.ctx.Scope.TryRegister(node, sym)
}
