ref: 56d2169a67ffa0b286ee501a22cbbb7da8946bb9
parent: d1db37f1bd7260d91a03a57cb136bc1c41f54909
author: Ori Bernstein <[email protected]>
date: Fri Feb 21 08:23:47 EST 2014
Add comment describing why we call setns() The reason we need to call this function is a bit subtle and annoying.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1337,6 +1337,12 @@
/* look up the prototype */
proto = NULL;
dcl = n->impl.decls[i];
+ /*
+ since the decls in an impl are not installed in a namespace, their names
+ are not updated when we call updatens() on the symbol table. Since we need
+ to do namespace dependent comparisons for specializing, we need to set the
+ namespace.
+ */
setns(dcl->decl.name, namestr(file->file.globls->name));
for (j = 0; j < t->nfuncs; j++) {
if (nameeq(dcl->decl.name, t->funcs[j]->decl.name)) {