From 70f7f15781c4e8000dbcc927984c3198f92ba15e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 25 Feb 2024 15:28:46 -0500 Subject: Implement reductions --- typecheck.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'typecheck.c') diff --git a/typecheck.c b/typecheck.c index 57dc9970..15e230e8 100644 --- a/typecheck.c +++ b/typecheck.c @@ -497,6 +497,8 @@ type_t *get_type(env_t *env, ast_t *ast) set_binding(scope, "$lhs", new(binding_t, .type=value_t)); set_binding(scope, "$rhs", new(binding_t, .type=value_t)); type_t *t = get_type(scope, reduction->combination); + if (!reduction->fallback) + return t; type_t *fallback_t = get_type(env, reduction->fallback); if (fallback_t->tag == AbortType) return t; -- cgit v1.2.3