aboutsummaryrefslogtreecommitdiff
path: root/src/compile
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-11-23 13:52:15 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-11-23 13:52:15 -0500
commit80505a7eb147422226d1b86da17f516982d0f4c8 (patch)
tree9265fd867d115711192705e6688a29df573fd057 /src/compile
parent0fa9a52090eb5d9ce88220c0134a8d2af6eb8d94 (diff)
Better error messages and bugfix for compile_to_type logic
Diffstat (limited to 'src/compile')
-rw-r--r--src/compile/functions.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compile/functions.c b/src/compile/functions.c
index 4a2812ba..cce93e3d 100644
--- a/src/compile/functions.c
+++ b/src/compile/functions.c
@@ -163,12 +163,12 @@ Text_t compile_function_call(env_t *env, ast_t *ast) {
args = new (arg_t, .name = a->name, .type = get_type(env, a->value), .next = args);
REVERSE_LIST(args);
code_err(ast,
- "This function's signature doesn't match this call site.\n"
- "The signature is: ",
- type_to_text(fn_t),
- "\n"
- "But it's being called with: ",
- type_to_text(Type(FunctionType, .args = args)));
+ "This function's signature doesn't match this call site. \n"
+ " The function takes these args: (",
+ arg_types_to_text(Match(fn_t, FunctionType)->args, ", "),
+ ") \n"
+ " But it's being called with: (",
+ arg_types_to_text(args, ", "), ")");
}
}
return Texts(fn, "(", compile_arguments(env, ast, Match(fn_t, FunctionType)->args, call->args), ")");