mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 22:04:21 +00:00
26 lines
604 B
Zig
26 lines
604 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
const builtin = @import("builtin");
|
|
|
|
test "struct contains null pointer which contains original struct" {
|
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
|
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
|
|
|
var x: ?*NodeLineComment = null;
|
|
_ = &x;
|
|
try expect(x == null);
|
|
}
|
|
|
|
pub const Node = struct {
|
|
id: Id,
|
|
comment: ?*NodeLineComment,
|
|
|
|
pub const Id = enum {
|
|
Root,
|
|
LineComment,
|
|
};
|
|
};
|
|
|
|
pub const NodeLineComment = struct {
|
|
base: Node,
|
|
};
|