diff options
Diffstat (limited to 'type-check.c')
-rw-r--r-- | type-check.c | 7 |
1 files changed, 3 insertions, 4 deletions
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; |