diff options
-rw-r--r-- | interpret.c | 2 | ||||
-rw-r--r-- | type-check.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/interpret.c b/interpret.c index d5b261d..defb194 100644 --- a/interpret.c +++ b/interpret.c @@ -496,4 +496,6 @@ interpret (ast_t *ast) current = next; } + + g_assert (stack->a->len == 0); } diff --git a/type-check.c b/type-check.c index fc1d149..f200d1a 100644 --- a/type-check.c +++ b/type-check.c @@ -153,11 +153,10 @@ compatible_functions (ast_function_type_spec_t *left, return report_error ("Incompatible argument types\n"); } - if ((is_void (left->return_) && !is_void (right->return_)) || - (is_void (right->return_) && !is_void (left->return_))) + if (!assignable (left->return_, right->return_) && + !is_void (left->return_)) { - return report_error ("Void and non-void functions " - "are not compatible\n"); + return FALSE; } return TRUE; |