diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-25 15:28:46 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-25 15:28:46 -0500 |
| commit | 70f7f15781c4e8000dbcc927984c3198f92ba15e (patch) | |
| tree | 7f3469cb097db0fdfc845cd6edd0687de034036c /typecheck.c | |
| parent | 18db0fcee83f448258c17c7ac6ab80c623685666 (diff) | |
Implement reductions
Diffstat (limited to 'typecheck.c')
| -rw-r--r-- | typecheck.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |
