struct D { int gi; } struct I { int f; D base; alias base this; void gi(double ) @property {} void gi(uint ) @property {} } struct S { int d; I i; alias i this; int gm() @property {return 0;} int gc() const @property {return 0;} void gs(int) @property {} } static assert(!hasField!(S, "gi")); static assert(!hasField!(S, "gs")); static assert(!hasField!(S, "gc")); static assert(!hasField!(S, "gm")); static assert(!hasField!(S, "gi")); static assert(hasField!(S, "d")); static assert(hasField!(S, "f")); static assert(hasField!(S, "i"));
with classes
class I { int f; void gi(double ) @property {} void gi(uint ) @property {} } class S { int d; I i; alias i this; int gm() @property {return 0;} int gc() const @property {return 0;} void gs(int) @property {} } static assert(!hasField!(S, "gi")); static assert(!hasField!(S, "gs")); static assert(!hasField!(S, "gc")); static assert(!hasField!(S, "gm")); static assert(hasField!(S, "d")); static assert(hasField!(S, "f")); static assert(hasField!(S, "i"));