summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/types.c b/types.c
index b5ba6c9..9c9208c 100644
--- a/types.c
+++ b/types.c
@@ -408,7 +408,7 @@ static bool type_of_ident(Typer *tr, Location where, Identifier i, Type *t) {
if (!type_of_fn(tr, d->expr.fn, t, 0)) return false;
return true;
} else {
- if (location_after(d->where, where)) {
+ if (where.start <= d->where.end) {
char *s = ident_to_str(i);
err_print(where, "Use of identifier %s before its declaration.\nNote that it is only possible to use a constant function before it is directly declared (e.g. x ::= fn() {}).", s);
info_print(d->where, "%s will be declared here.", s);