summaryrefslogtreecommitdiff
path: root/parse/infer.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-04-08 01:17:34 -0700
committerOri Bernstein <ori@eigenstate.org>2018-04-08 01:17:34 -0700
commitc80d62a29435e75e476a93f0d7da3deb20e1204a (patch)
tree821f070f49620700c376360351708eaebadfd366 /parse/infer.c
parentf9f93d1e447873ca3e5fa6c542eb34e8dd8d4b71 (diff)
downloadmc-c80d62a29435e75e476a93f0d7da3deb20e1204a.tar.gz
Add support for `-T` option to compile in test mode.
Tests can now access hidden declarations.
Diffstat (limited to 'parse/infer.c')
-rw-r--r--parse/infer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index e0ca86e..2e99e40 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -29,6 +29,7 @@ struct Traitmap {
size_t nfiltertr;
};
+int allowhidden;
static void infernode(Node **np, Type *ret, int *sawret);
static void inferexpr(Node **np, Type *ret, int *sawret);
@@ -70,6 +71,7 @@ static Stab **specializationscope;
static size_t nspecializationscope;
static Traitmap *traitmap;
+
static void
ctxstrcall(char *buf, size_t sz, Node *n)
{
@@ -1320,7 +1322,7 @@ initvar(Node *n, Node *s)
Type *t, *param;
Tysubst *subst;
- if (s->decl.ishidden)
+ if (s->decl.ishidden && !allowhidden)
fatal(n, "attempting to refer to hidden decl %s", ctxstr(n));
param = n->expr.param;