Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unexpected behavior of const data in compile time loop unrolling #740
Taking a slice of a const in an comptime unrolled loop yields unexpected results. Possibly related to #699.
referenced this issue
Feb 3, 2018
This is a bug in Zig when a var or const has different types in different comptime iterations of the while loop.
For example, when i is 0,
A workaround until the bug is fixed is to make it an expression instead of saving it in a variable: