struct S { int m; }
string m() { return "m"; }
@nogc void f() {
S s;
auto x = __traits(getMember, s, m()); // Error: `@nogc` function `nogc.f` cannot call non-@nogc function `nogc.m`
}
Of course, this can be worked around with:
enum M = m();
auto x = __traits(getMember, s, M);
But the m() call is in compile-time, and should not relate to the runtime @nogc enforcement inside f().