Zig Version
0.10.0-dev.1462+b48d8cce5
Steps to Reproduce
I wrote some wrong piece of code that was essentially this:
var lol : i32 = 1;
var lolpointer : *i32 = &lol;
var items = [_]i32 { 4, 5, 3, 4, 0 };
for (items) |*item| {
lolpointer = &item;
}
The error is on the lolpointer = &item line, but the error message is:
.\src\main.zig:14:19: error: expected type '*i32', found '*const *i32'
for (items) |*item| {
^
.\src\main.zig:14:19: note: cast discards const qualifier
for (items) |*item| {
My code was a bit more complex so it took me a while to figure out what I had done wrong.
Expected Behavior
I would expect the compile error to point to the place where I'm doing the assignment, not the loop "header".
Actual Behavior
See above
Zig Version
0.10.0-dev.1462+b48d8cce5
Steps to Reproduce
I wrote some wrong piece of code that was essentially this:
The error is on the lolpointer = &item line, but the error message is:
My code was a bit more complex so it took me a while to figure out what I had done wrong.
Expected Behavior
I would expect the compile error to point to the place where I'm doing the assignment, not the loop "header".
Actual Behavior
See above