mirror of
https://github.com/ziglang/zig.git
synced 2026-01-04 12:33:19 +00:00
add behavior test for previous commit
This commit is contained in:
parent
7560fc716d
commit
dd58278dbe
@ -375,3 +375,14 @@ test "sentinel of opaque pointer type" {
|
||||
const c_void_info = @typeInfo(*c_void);
|
||||
expect(c_void_info.Pointer.sentinel == null);
|
||||
}
|
||||
|
||||
test "@typeInfo does not force declarations into existence" {
|
||||
const S = struct {
|
||||
x: i32,
|
||||
|
||||
fn doNotReferenceMe() void {
|
||||
@compileError("test failed");
|
||||
}
|
||||
};
|
||||
comptime expect(@typeInfo(S).Struct.fields.len == 1);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user