const std = @import("std"); fn Foo(comptime T: type) type { return struct { usingnamespace T; }; } test "usingnamespace inside a generic struct" { const std2 = Foo(std); const testing2 = Foo(std.testing); try std2.testing.expect(true); try testing2.expect(true); } usingnamespace struct { pub const foo = 42; }; test "usingnamespace does not redeclare an imported variable" { comptime try std.testing.expect(foo == 42); }