From eb8b501b95e4d8704245375eb5f532303cc8e2e7 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 10 Mar 2025 12:55:01 -0400 Subject: For langs, do promotion to Text and text interpolation automatically and without adding quoting. --- types.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'types.c') 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; -- cgit v1.2.3