aboutsummaryrefslogtreecommitdiff
path: root/src/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/types.c')
-rw-r--r--src/types.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/types.c b/src/types.c
index e1ada1f8..91848bef 100644
--- a/src/types.c
+++ b/src/types.c
@@ -384,10 +384,10 @@ PUREFUNC bool can_promote(type_t *actual, type_t *needed)
return true;
}
- if (needed->tag == ClosureType && actual->tag == FunctionType)
+ if (actual->tag == FunctionType && needed->tag == ClosureType)
return can_promote(actual, Match(needed, ClosureType)->fn);
- if (needed->tag == ClosureType && actual->tag == ClosureType)
+ if (actual->tag == ClosureType && needed->tag == ClosureType)
return can_promote(Match(actual, ClosureType)->fn, Match(needed, ClosureType)->fn);
if (actual->tag == FunctionType && needed->tag == FunctionType) {