pass correct location to return expression check

The `return` statement location was being used instead of the expression
location.
This commit is contained in:
tocariimaa 2025-01-15 13:07:17 -03:00
parent ad64813a67
commit 001a06dd2d

View file

@ -631,7 +631,7 @@ sema_return(SemaCtx *sctx, Ast *ret_expr, Location loc)
sema_error(sctx, &loc, "'return' outside of proc");
}
if (ret_expr != nil)
sema_expr(sctx, ret_expr, loc);
sema_expr(sctx, ret_expr, ret_expr->loc);
}
static void