On Tuesday, 7 July 2015 at 20:08:10 UTC, Daniel N wrote:
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
}
Pretty sure that is expected. Default params are evaluated in the
declaration scope, so typeof(this) is not defined in NodeT1. The
only things that break this rule are the special identifiers like
__FILE__ which are evaluated at the instantiation/call site.