aboutsummaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/types.c b/types.c
index ce5f9df0..2b421b40 100644
--- a/types.c
+++ b/types.c
@@ -358,6 +358,9 @@ PUREFUNC bool can_promote(type_t *actual, type_t *needed)
return true;
if (actual->tag == OptionalType) {
+ if (needed->tag == BoolType)
+ return true;
+
// Ambiguous `none` to concrete optional
if (Match(actual, OptionalType)->type == NULL)
return (needed->tag == OptionalType);