Sobeston / zig.guide

Repo for https://zig.guide content. Get up to speed with Zig quickly.
https://zig.guide
MIT License
688 stars 178 forks source link

Local variable is never mutated #236

Closed kitanoyoru closed 2 months ago

kitanoyoru commented 5 months ago

Found the bug with never mutated variables in tests

Screenshot 2024-05-09 at 19 27 08 Screenshot 2024-05-09 at 19 27 43
yellowsman commented 3 months ago

👍

Sobeston commented 2 months ago

Fixed in master. I decided against merging this as making index a const ruins the point of these tests; if index is a const then it is known at comptime, which means that no runtime out of bounds will happen as it is first caught at compile time.