summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-10-31 22:23:49 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2019-10-31 22:23:49 -0400
commit21b42cd9099d25b89f20789bf75f0833f2a5a980 (patch)
tree6917d0b486bd037b68ef136b60812b3ec461cf7d /types.c
parentebed63c4771e83d640ffef3bbcec980f98212365 (diff)
fixed the bug (but i'm not happy about the solution)
Diffstat (limited to 'types.c')
-rw-r--r--types.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/types.c b/types.c
index 641b922..ba82ed0 100644
--- a/types.c
+++ b/types.c
@@ -1200,10 +1200,6 @@ static bool types_decl(Typer *tr, Declaration *d) {
success = false;
goto ret;
}
- } else {
- /* if we can't find the type, default to unknown */
- d->type.flags = 0;
- d->type.kind = TYPE_UNKNOWN;
}
if (d->flags & DECL_FLAG_HAS_EXPR) {
if (!types_expr(tr, &d->expr)) {
@@ -1272,6 +1268,7 @@ static bool types_decl(Typer *tr, Declaration *d) {
/* use unknown type if we didn't get the type */
d->type.flags = 0;
d->type.kind = TYPE_UNKNOWN;
+ tr->evalr->enabled = false; /* disable evaluator completely so that it doesn't accidentally try to access this declaration */
}
arr_remove_last(&tr->in_decls);
return success;