mirror of
https://github.com/ziglang/zig.git
synced 2025-12-26 08:03:08 +00:00
Closes #6312. In the C++ implementation this caused a stack overflow from infinite recursion during analysis.
11 lines
232 B
Zig
11 lines
232 B
Zig
const ListNode = struct {
|
|
next: ?*const @This() = null,
|
|
};
|
|
|
|
test "copy array of self-referential struct" {
|
|
comptime var nodes = [_]ListNode{ .{}, .{} };
|
|
nodes[0].next = &nodes[1];
|
|
const copy = nodes;
|
|
_ = copy;
|
|
}
|