From b848ae7abb87e3c6a6cb75669d532683dfac5518 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 29 May 2023 23:27:42 +0100 Subject: Improve error message for `#reverse` on an interval --- src/check_stmt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/check_stmt.cpp') 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; -- cgit v1.2.3