The following code compiles, where it clearly shouldn't:
const std = @import("std");
const S = struct {
fn f(_: *S) void {}
};
pub fn main() !void {
const alloc = std.heap.smp_allocator;
// The next line should be const, not var,
// but the compiler does not complain.
var s = try alloc.create(S);
s.f();
}
I suspect that this might be the same issue as this one:
https://github.com/ziglang/zig/issues/25540
but I am not 100% sure, and as GitHub is closed for comments now (and on top of that, I don't have a Codeberg account yet), I'm not sure how o proceed.
GitHub
Zig Version 0.16.0-dev.699+529aa9f27 Steps to Reproduce and Observed Behavior I've run into this a few times now and thought I was going crazy. Locally, everything would be fine but CI would fa...