add behavior test for previous commit

master
Andrew Kelley 2020-02-18 15:28:14 -05:00
parent 7560fc716d
commit dd58278dbe
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 11 additions and 0 deletions

View File

@ -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);
}