aboutsummaryrefslogtreecommitdiff
path: root/src/compile/integers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compile/integers.c')
-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);