From 235dbc07a9dd15967cebe136342249372b0285e0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 1 Oct 2025 13:19:05 -0400 Subject: Bugfix for compiling optional fixed-size ints --- src/compile/integers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/compile') diff --git a/src/compile/integers.c b/src/compile/integers.c index 4747f8ba..41c2b78a 100644 --- a/src/compile/integers.c +++ b/src/compile/integers.c @@ -25,7 +25,8 @@ Text_t compile_int_to_type(env_t *env, ast_t *ast, type_t *target) { if (target->tag == BigIntType) return compile(env, ast); if (target->tag == OptionalType && Match(target, OptionalType)->type) - return compile_int_to_type(env, ast, Match(target, OptionalType)->type); + return Texts("((", compile_type(target), + "){.value=", compile_int_to_type(env, ast, Match(target, OptionalType)->type), "})"); const char *literal = Match(ast, Int)->str; OptionalInt_t int_val = Int$from_str(literal); -- cgit v1.2.3