From dc7289b239fafe29df44ced065cd8861ceb1fec3 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 4 Nov 2024 01:24:28 -0500 Subject: [PATCH] Fix for optional langs --- compile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compile.c b/compile.c index 5a481e0..072b4dc 100644 --- a/compile.c +++ b/compile.c @@ -272,7 +272,9 @@ CORD compile_type(type_t *t) case CStringType: case FunctionType: case ClosureType: case PointerType: case EnumType: case ChannelType: return compile_type(nonnull); - case IntType: case BigIntType: case TextType: case NumType: case BoolType: case ByteType: + case TextType: + return Match(nonnull, TextType)->lang ? compile_type(nonnull) : "OptionalText_t"; + case IntType: case BigIntType: case NumType: case BoolType: case ByteType: case ArrayType: case TableType: case SetType: case DateTimeType: return CORD_all("Optional", compile_type(nonnull)); case StructType: {