aboutsummaryrefslogtreecommitdiff
path: root/src/compile
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-10-01 13:19:36 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-10-01 13:19:36 -0400
commit1b307918c9f0ee6cf3dd074e0b9d9db1ffd35fb8 (patch)
tree9a48b9fba8dcfa0bf9afb46c67defbd5784b7a44 /src/compile
parent6be5430c131311106d720a4573e7509bd8b5a346 (diff)
parent235dbc07a9dd15967cebe136342249372b0285e0 (diff)
Merge branch 'dev' into zero-nones
Diffstat (limited to 'src/compile')
-rw-r--r--src/compile/integers.c3
1 files changed, 2 insertions, 1 deletions
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);