Commit 2ad6ca581d
Changed files (1)
test
behavior
bugs
test/behavior/bugs/6305.zig
@@ -0,0 +1,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;
+}