mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
fix(std.testing.refAllDeclsRecursive): silently return if !builtin.is_test
This commit is contained in:
parent
295451dfe5
commit
fda0b2c372
@ -730,6 +730,7 @@ pub fn refAllDecls(comptime T: type) void {
|
||||
/// Given a type, and Recursively reference all the declarations inside, so that the semantic analyzer sees them.
|
||||
/// For deep types, you may use `@setEvalBranchQuota`
|
||||
pub fn refAllDeclsRecursive(comptime T: type) void {
|
||||
if (!builtin.is_test) return;
|
||||
inline for (comptime std.meta.declarations(T)) |decl| {
|
||||
if (decl.is_pub) {
|
||||
if (@TypeOf(@field(T, decl.name)) == type) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user