summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/types.c b/types.c
index 2d2d63a..9766997 100644
--- a/types.c
+++ b/types.c
@@ -3395,6 +3395,14 @@ static Status types_stmt(Typer *tr, Statement *s) {
return false;
}
} break;
+ case STMT_DEFER:
+ if (!types_stmt(tr, s->defer))
+ return false;
+ if (s->defer->kind == STMT_DEFER) {
+ err_print(s->where, "You can't defer a defer!");
+ return false;
+ }
+ break;
}
s->flags |= STMT_TYPED;
return true;