Closed
Description
Zig Version
0.12.0-dev.926+3be8490d8
Steps to Reproduce and Observed Behavior
The following codes cannot be compiled.
const A = struct {
b: ?*B = null,
n: usize,
};
const B = struct {
a: A = A{ .n = 1 },
};
pub fn main() void {
_ = A{ .n = 10 };
}
$ zig build-exe false_dependency_loop.zig
false_dependency_loop.zig:1:11: error: struct 'false_dependency_loop.A' depends on itself
const A = struct {
^~~~~~
$
Expected Behavior
I expect the compile gets successful since A.b is a pointer.