diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-10 12:55:01 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-10 12:55:01 -0400 |
| commit | eb8b501b95e4d8704245375eb5f532303cc8e2e7 (patch) | |
| tree | 0b942ed50e368e3813bdcdb150fed82fe700e630 /types.c | |
| parent | 793cda6013ad723018c3ff6c7654d9aa4eb3ada5 (diff) | |
For langs, do promotion to Text and text interpolation automatically and without adding quoting.
Diffstat (limited to 'types.c')
| -rw-r--r-- | types.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |
