summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types.c b/types.c
index e4178e6..d3eb72d 100644
--- a/types.c
+++ b/types.c
@@ -2108,6 +2108,7 @@ static Status types_expr(Typer *tr, Expression *e) {
e->binary.lhs = used;
e->binary.rhs = typer_calloc(tr, 1, sizeof *e->binary.rhs);
e->binary.rhs->kind = EXPR_IDENT;
+ e->binary.rhs->flags = 0;
e->binary.rhs->ident_str.str = i_str;
e->binary.rhs->ident_str.len = i_len;
/* re-type */
@@ -3131,6 +3132,7 @@ static Status types_expr(Typer *tr, Expression *e) {
return false;
}
rhs->kind = EXPR_IDENT;
+ rhs->flags = 0;
rhs->ident_str.str = val.slice.data;
rhs->ident_str.len = (size_t)val.slice.len;
/* re-type with new expression */
@@ -3314,6 +3316,8 @@ static Status types_expr(Typer *tr, Expression *e) {
free(s);
return false;
}
+ if (rhs->kind == EXPR_IDENT)
+ assert(!(rhs->flags & EXPR_FOUND_TYPE));
} break;
} break;
} break;