authorgravatar for leecannon@leecannon.xyzLee Cannon <leecannon@leecannon.xyz> 2022-02-18 19:21:21+00:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-02-18 21:21:21+02:00
logdee96e2e2f464c3b8edc8ec3a63cd3b1860e3a9d
treeda6e3a36c5e2869b520c91643c6702f7f06f240c
parent2c24bf2f79af8d258956d3169e0c64ac8e71e51d
signature Signed by PGP key 4AEE18F83AFDEB23

std.testing.refAllDecls: force decl to be analyzed with just `@field`

Co-authored-by: Veikka Tuominen <git@vexu.eu>

1 files changed, 1 insertions(+), 3 deletions(-)

lib/std/testing.zig+1-3
......@@ -466,8 +466,6 @@ test {
466466pub fn refAllDecls(comptime T: type) void {
467467 if (!builtin.is_test) return;
468468 inline for (comptime std.meta.declarations(T)) |decl| {
469 if (decl.is_pub and @typeInfo(@TypeOf(@field(T, decl.name))) == .Struct)
470 _ = @hasDecl(@field(T, decl.name), "foo");
471 _ = decl;
469 if (decl.is_pub) _ = @field(T, decl.name);
472470 }
473471}