aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-12-03 12:25:45 +0000
committergingerBill <bill@gingerbill.org>2020-12-03 12:25:45 +0000
commit828fe2ce56402a667ac7f5d79bf4575763c7c0d0 (patch)
treece02842f6b68a03f07804254375b6d537b8f6ae1 /src/check_stmt.cpp
parent18da0b3418511c013cc3a06df72f50d4abc00042 (diff)
Fix #795
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index ad72256c3..8a41dd12b 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -1636,8 +1636,7 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
} else if (operands.count != result_count) {
error(node, "Expected %td return values, got %td", result_count, operands.count);
} else {
- isize max_count = rs->results.count;
- for (isize i = 0; i < max_count; i++) {
+ for (isize i = 0; i < result_count; i++) {
Entity *e = pt->results->Tuple.variables[i];
check_assignment(ctx, &operands[i], e->type, str_lit("return statement"));
}