From 3485a0e7fbff913e6c934fbc843a02ac08f024f2 Mon Sep 17 00:00:00 2001 From: r00ster91 Date: Sat, 29 Apr 2023 17:07:54 +0200 Subject: Sema: fix and improve errors for `for` loop objects and non-indexables Operands to @memcpy and @memset were being called "for loop operands" in the error. --- test/cases/compile_errors/array_access_of_non_array.zig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test/cases/compile_errors/array_access_of_non_array.zig') diff --git a/test/cases/compile_errors/array_access_of_non_array.zig b/test/cases/compile_errors/array_access_of_non_array.zig index 06fa1569e6..0f06bae1dd 100644 --- a/test/cases/compile_errors/array_access_of_non_array.zig +++ b/test/cases/compile_errors/array_access_of_non_array.zig @@ -1,9 +1,9 @@ export fn f() void { - var bad : bool = undefined; + var bad: bool = undefined; bad[0] = bad[0]; } export fn g() void { - var bad : bool = undefined; + var bad: bool = undefined; _ = bad[0]; } @@ -11,5 +11,7 @@ export fn g() void { // backend=stage2 // target=native // -// :3:8: error: element access of non-indexable type 'bool' -// :7:12: error: element access of non-indexable type 'bool' +// :3:8: error: type 'bool' does not support indexing +// :3:8: note: operand must be an array, slice, tuple, or vector +// :7:12: error: type 'bool' does not support indexing +// :7:12: note: operand must be an array, slice, tuple, or vector -- cgit v1.2.3