summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/types.c b/types.c
index 7e9e929..021c3ee 100644
--- a/types.c
+++ b/types.c
@@ -379,6 +379,15 @@ static bool type_of_expr(Typer *tr, Expression *e) {
return false;
}
} break;
+ case EXPR_WHILE: {
+ WhileExpr *w = &e->while_;
+ if (!types_block(tr, &w->body))
+ return false;
+ if (!type_of_expr()) {
+ /* TODO: is type_of_expr really necessary? why not just never descend into fns unless it's a decl? */
+ }
+ *t = w->body.ret_expr->type;
+ } break;
case EXPR_CALL: {
CallExpr *c = &e->call;
Expression *f = c->fn;