diff options
| author | gingerBill <bill@gingerbill.org> | 2023-05-29 23:27:42 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-05-29 23:27:42 +0100 |
| commit | b848ae7abb87e3c6a6cb75669d532683dfac5518 (patch) | |
| tree | 3107b2b38e1830e9f65e4072d4bf17aed1b784e2 /src/check_stmt.cpp | |
| parent | f07453d0aee436ba8c0f81cedfde5db3a7bbe1b4 (diff) | |
Improve error message for `#reverse` on an interval
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 73aaa1c37..bf55be072 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1479,7 +1479,7 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) array_add(&vals, t_int); if (is_reverse) { - error(node, "#reverse for is not yet supported with ranges"); + error(node, "#reverse for is not supported with ranges, prefer an explicit for loop with init, condition, and post arguments"); } } else { Operand operand = {Addressing_Invalid}; @@ -1546,7 +1546,7 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) array_add(&vals, t->Map.key); array_add(&vals, t->Map.value); if (is_reverse) { - error(node, "#reverse for is not supported for map types"); + error(node, "#reverse for is not supported for map types, as maps are unordered"); } break; |