summaryrefslogtreecommitdiff
path: root/parse/infer.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-11-28 12:00:09 -0800
committerOri Bernstein <ori@markovcorp.com>2017-11-28 12:03:31 -0800
commit1af62a6b4e9e10444098c57f64b1ad1b9cb03b95 (patch)
treefb70492f26f42a7903dd2013f63b6506e7b239c0 /parse/infer.c
parent3df8885d396e1bc36fe25a329bc4e63400126ecf (diff)
downloadmc-1af62a6b4e9e10444098c57f64b1ad1b9cb03b95.tar.gz
Allow local variables to shadow namespaces.
It means you can't access the namespace in that scope, but it also means that we don't get the weird behavior that the undotted name refers to the variable, but the dotted name refers to the namespace. Fixes #158
Diffstat (limited to 'parse/infer.c')
-rw-r--r--parse/infer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 2563a92..b299599 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1398,7 +1398,7 @@ checkns(Node *n, Node **ret)
return n;
name = args[0]->expr.args[0];
stab = getns(namestr(name));
- if (!stab)
+ if (!stab || getdcl(curstab(), name))
return n;
/* substitute the namespaced name */