summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/types.c b/types.c
index c2b7ead..5e1092f 100644
--- a/types.c
+++ b/types.c
@@ -1143,9 +1143,9 @@ static Status types_fn(Typer *tr, FnExpr *f, Type *t, Instance *instance) {
goto ret;
}
}
- /* TODO: this should really be at the closing brace, and not the function declaration */
char *expected = type_to_str(ret_type);
- err_print(token_location(f->body.where.file, f->body.where.end), "No return value in function which returns %s.", expected);
+ err_print(token_location(f->body.where.file, &f->body.where.file->tokens[f->body.where.end-1]),
+ "No return value in function which returns %s.", expected);
free(expected);
info_print(f->where, "Function was declared here:");
success = false;