So I have this function:
pub fn find(comptime name: [:0]const u8, comptime uniforms: []const UniformInfo) UniformInfo {
for (uniforms) |un| {
if (std.mem.eql(u8, un.name, name)) {
return un;
}
}
@compileError("Unknown uniform field name");
}
And for some reason the compile error gets triggered, even though the function returns correctly and when I comment the @error out it works perfectly fine. Why is this?