master
1const std = @import("std");
2const expect = std.testing.expect;
3const builtin = @import("builtin");
4
5test "struct contains null pointer which contains original struct" {
6 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
7 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
8
9 var x: ?*NodeLineComment = null;
10 _ = &x;
11 try expect(x == null);
12}
13
14pub const Node = struct {
15 id: Id,
16 comment: ?*NodeLineComment,
17
18 pub const Id = enum {
19 Root,
20 LineComment,
21 };
22};
23
24pub const NodeLineComment = struct {
25 base: Node,
26};