aboutsummaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types.c b/types.c
index 16a77528..60168a86 100644
--- a/types.c
+++ b/types.c
@@ -289,6 +289,10 @@ bool can_promote(type_t *actual, type_t *needed)
return cmp == NUM_PRECISION_EQUAL || cmp == NUM_PRECISION_LESS;
}
+ // Text to C String
+ if (actual->tag == TextType && !Match(actual, TextType)->lang && needed->tag == CStringType)
+ return true;
+
// Automatic dereferencing:
if (actual->tag == PointerType && !Match(actual, PointerType)->is_optional
&& can_promote(Match(actual, PointerType)->pointed, needed))