| author | |
| committer | |
| log | dd58278dbe8ac89a9e685a966b5f05f80f463798 |
| tree | 9334f79406c066a327ccaf8b20f267555d8dca29 |
| parent | 7560fc716d968f2448bed370affd6162d1e784c4 |
| signature | Commit is signed but in an unrecognized format. |
1 files changed, 11 insertions(+), 0 deletions(-)
test/stage1/behavior/type_info.zig+11| ... | ... | @@ -375,3 +375,14 @@ test "sentinel of opaque pointer type" { |
| 375 | 375 | const c_void_info = @typeInfo(*c_void); |
| 376 | 376 | expect(c_void_info.Pointer.sentinel == null); |
| 377 | 377 | } |
| 378 | ||
| 379 | test "@typeInfo does not force declarations into existence" { | |
| 380 | const S = struct { | |
| 381 | x: i32, | |
| 382 | ||
| 383 | fn doNotReferenceMe() void { | |
| 384 | @compileError("test failed"); | |
| 385 | } | |
| 386 | }; | |
| 387 | comptime expect(@typeInfo(S).Struct.fields.len == 1); | |
| 388 | } |