aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/bugs/6305.zig
blob: 6912944ad1318f719b69c70eda39bdcfc7f31579 (plain)
1
2
3
4
5
6
7
8
9
10
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;
}