phobos/std/internal/test/uda.d
Ryan Roden-Corrent 79fd6aac79 Enable getSymbolsByUDA to retrieve private members.
Resolves #15335: getSymbolsByUDA fails if type has private members.
Generous (ab)use of mixins allows getSymbolsByUDA to reference symbols
without trying to access them, allowing it to inspect private members
without failing.

Testing this required private symbols defined outside of std.traits.
This adds std.internal.test.uda, which defines a struct containing
private members that is used in a unittest added to std.traits.
2015-11-28 07:14:47 -05:00

16 lines
273 B
D

/**
For testing only.
Provides a struct with UDA's defined in an external module.
Useful for validating behavior with member privacy.
*/
module std.internal.test.uda;
enum Attr;
struct HasPrivateMembers
{
@Attr int a;
int b;
@Attr private int c;
private int d;
}