-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.