Error: this is not in a class or struct scope mixin template NodeT1(T = typeof(this)) { } mixin template NodeT2() { alias T = typeof(this); } struct Node { mixin NodeT1; // fail mixin NodeT2; // pass }