aboutsummaryrefslogtreecommitdiff
path: root/src/compile/promotions.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-01 13:20:39 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-01 13:20:39 -0400
commitd6d3f5711de85ab1c21f515b9d125d316d853c92 (patch)
treedc083bbe83b2dae82c47fdd78950941d53399bad /src/compile/promotions.c
parentdb6107c33df6a4fdb592ad29074d1159c37dc048 (diff)
parentee020c72d92c3807fa4afcd1e170d3df81688b97 (diff)
Merge branch 'main' into formatter
Diffstat (limited to 'src/compile/promotions.c')
-rw-r--r--src/compile/promotions.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compile/promotions.c b/src/compile/promotions.c
index fcedce3f..6595e5aa 100644
--- a/src/compile/promotions.c
+++ b/src/compile/promotions.c
@@ -43,12 +43,12 @@ bool promote(env_t *env, ast_t *ast, Text_t *code, type_t *actual, type_t *neede
// Automatic optional checking for nums:
if (needed->tag == NumType && actual->tag == OptionalType && Match(actual, OptionalType)->type->tag == NumType) {
int64_t line = get_line_number(ast->file, ast->start);
- *code = Texts("({ ", compile_declaration(actual, Text("opt")), " = ", *code, "; ", "if unlikely (",
- check_none(actual, Text("opt")), ")\n", "#line ", String(line), "\n", "fail_source(",
- quoted_str(ast->file->filename), ", ", String((int64_t)(ast->start - ast->file->text)), ", ",
- String((int64_t)(ast->end - ast->file->text)), ", ",
- "\"This was expected to be a value, but it's none\");\n",
- optional_into_nonnone(actual, Text("opt")), "; })");
+ *code =
+ Texts("({ ", compile_declaration(actual, Text("opt")), " = ", *code, "; ", "if unlikely (",
+ check_none(actual, Text("opt")), ")\n", "#line ", line, "\n", "fail_source(",
+ quoted_str(ast->file->filename), ", ", (int64_t)(ast->start - ast->file->text), ", ",
+ (int64_t)(ast->end - ast->file->text), ", ", "\"This was expected to be a value, but it's none\");\n",
+ optional_into_nonnone(actual, Text("opt")), "; })");
return true;
}