aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-16 15:48:06 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-16 15:48:06 -0400
commit821bde156c222c7384c67517d773dc14a03342e7 (patch)
treeb8a4ffacbbfc99743208f0d7a0ad09cc3dd0e01e /typecheck.c
parent2e184ab46e01db678cef676843a02ce7d3adb085 (diff)
Support (optional or skip)
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) {