aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/for.zig
AgeCommit message (Collapse)Author
2025-01-03Zir: split up start and end of range in `for_len`mlugg
The old lowering was kind of neat, but it unintentionally allowed the syntax `for (123) |_| { ... }`, and there wasn't really a way to fix that. So, instead, we include both the start and the end of the range in the `for_len` instruction (each operand to `for` now has *two* entries in this multi-op instruction). This slightly increases the size of ZIR for loops of predominantly indexables, but the difference is small enough that it's not worth complicating ZIR to try and fix it.
2023-11-19test: update cases to silence 'var is never mutated' errorsmlugg
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-06Sema: fix and improve errors for `for` loop objects and non-indexablesr00ster91
Operands to @memcpy and @memset were being called "for loop operands" in the error.
2023-02-18implement error for unbounded for loopsAndrew Kelley
2023-02-18improve error message for byref capture of byval arrayAndrew Kelley
2023-02-18fix source location for not-indexable for loop errorsAndrew Kelley
2023-02-18Sema: improve error message for mismatched for loop lengthsAndrew Kelley