Hey! I'm pretty new to Zig, and I ran into this error. It kind of baffles me. I reduced my code down to this simple example:
pub fn MyExample() type {
return struct {
x: usize = 0,
};
}
// In this outer scope, it's implicitly comptime
// so I would expect that the type is fully known
const TheExample = MyExample();
test {
var ex = TheExample {};
try expectEqual(0, ex.x);
// error: unable to resolve comptime value
}
test {
var ex = TheExample {};
try expectEqual(ex.x, 0);
// This works, but the expected value should be the first param, not the second
}