std.testing.refAllDecls: force decl to be analyzed with just @field
Co-authored-by: Veikka Tuominen <git@vexu.eu>
This commit is contained in:
@@ -466,8 +466,6 @@ test {
|
||||
pub fn refAllDecls(comptime T: type) void {
|
||||
if (!builtin.is_test) return;
|
||||
inline for (comptime std.meta.declarations(T)) |decl| {
|
||||
if (decl.is_pub and @typeInfo(@TypeOf(@field(T, decl.name))) == .Struct)
|
||||
_ = @hasDecl(@field(T, decl.name), "foo");
|
||||
_ = decl;
|
||||
if (decl.is_pub) _ = @field(T, decl.name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user