aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/typecheck.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/typecheck.c b/src/typecheck.c
index ba30931e..d99048ff 100644
--- a/src/typecheck.c
+++ b/src/typecheck.c
@@ -1829,6 +1829,8 @@ PUREFUNC bool can_compile_to_type(env_t *env, ast_t *ast, type_t *needed)
return ptr->is_stack && can_compile_to_type(env, Match(ast, StackReference)->value, ptr->pointed);
else
return can_promote(actual, needed);
+ } else if (actual->tag == OptionalType && needed->tag != OptionalType) {
+ return false;
} else {
return can_promote(actual, needed);
}