From 821bde156c222c7384c67517d773dc14a03342e7 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 16 Sep 2024 15:48:06 -0400 Subject: Support (optional or skip) --- typecheck.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'typecheck.c') 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) { -- cgit v1.2.3