pass correct location to return expression check
The `return` statement location was being used instead of the expression location.
This commit is contained in:
parent
ad64813a67
commit
001a06dd2d
1 changed files with 1 additions and 1 deletions
|
@ -631,7 +631,7 @@ sema_return(SemaCtx *sctx, Ast *ret_expr, Location loc)
|
||||||
sema_error(sctx, &loc, "'return' outside of proc");
|
sema_error(sctx, &loc, "'return' outside of proc");
|
||||||
}
|
}
|
||||||
if (ret_expr != nil)
|
if (ret_expr != nil)
|
||||||
sema_expr(sctx, ret_expr, loc);
|
sema_expr(sctx, ret_expr, ret_expr->loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Reference in a new issue