aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/typecheck.c b/typecheck.c
index 9ee5922a..f5e130f3 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -1021,6 +1021,8 @@ type_t *get_type(env_t *env, ast_t *ast)
|| (lhs_t->tag == ByteType && rhs_t->tag == ByteType)) {
return get_math_type(env, ast, lhs_t, rhs_t);
} else if (lhs_t->tag == OptionalType) {
+ if (rhs_t->tag == AbortType || rhs_t->tag == ReturnType)
+ return Match(lhs_t, OptionalType)->type;
if (can_promote(rhs_t, lhs_t))
return rhs_t;
} else if (lhs_t->tag == PointerType) {