mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
25 lines
582 B
Zig
25 lines
582 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_x86_64) return error.SkipZigTest;
|
|
var x: ?*NodeLineComment = null;
|
|
try expect(x == null);
|
|
}
|
|
|
|
pub const Node = struct {
|
|
id: Id,
|
|
comment: ?*NodeLineComment,
|
|
|
|
pub const Id = enum {
|
|
Root,
|
|
LineComment,
|
|
};
|
|
};
|
|
|
|
pub const NodeLineComment = struct {
|
|
base: Node,
|
|
};
|