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 c943eb85..358a729e 100644
--- a/types.c
+++ b/types.c
@@ -338,6 +338,10 @@ PUREFUNC bool can_promote(type_t *actual, type_t *needed)
if (needed->tag == EnumType)
return (enum_single_value_tag(needed, actual) != NULL);
+ // Lang to Text:
+ if (actual->tag == TextType && needed->tag == TextType && streq(Match(needed, TextType)->lang, "Text"))
+ return true;
+
// Text to C String
if (actual->tag == TextType && !Match(actual, TextType)->lang && needed->tag == CStringType)
return true;