currently you can't have opDispatch resolve to a non-member template: //break.d struct A { template opDispatch(string s) { mixin("alias opDispatch = " ~ s ~ ";"); } } struct B() { enum blah = 42; } unittest { alias Q = A.B!(); pragma(msg, Q.blah); } $ rdmd -unittest break.d break.d(1): Error: struct f477.A template identifier 'B' is not a member of 'struct A' break.d(1): Error: struct f477.A template identifier 'B' is not a member of 'struct A' 42 As you can see, the code works, 42 is the answer! Unfortunately there's the error... note: I'm not sure whether this is a bug report or an enhancement request, as I don't know what the current design is supposed to allow.
*** Issue 11685 has been marked as a duplicate of this issue. ***
I cannot reproduce this. It seems to have been fixed. Closing as WORKSFORME. Please reopen if I missed anything.