https://issues.dlang.org/show_bug.cgi?id=19303
Eduard Staniloiu <edi33...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |edi33...@gmail.com --- Comment #1 from Eduard Staniloiu <edi33...@gmail.com> --- This is most definitely a compiler bug which seems to be related/triggered my the template mixin, as `std.traits.hasMember` only calls the equivalent `__traits(hasMember, T, memberName)` compiler trait. As a workaround, you can use static assert(__traits(hasMember, P, "ElementType")); // passes Also, weirdly enough, swapping the mixin instantiation with the `static if` block in `Port`, will pass the initial assert ``` struct Port(SomeSignal) { static if(hasMember!(SomeSignal, "ElementType")) alias ElementType = SomeSignal.ElementType; mixin SignalOps; } void main() { ... static assert(hasMember!(P, "ElementType")); // OK static assert(__traits(hasMember, P, "ElementType")); // OK } ``` You can check this on https://run.dlang.io/is/6aXcGq --