https://issues.dlang.org/show_bug.cgi?id=16125
ag0ae...@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |ag0ae...@gmail.com Resolution|--- |DUPLICATE --- Comment #1 from ag0ae...@gmail.com --- (In reply to Tomer Filiba from comment #0) > enum Stub(string s) = s; This expands to `template Stub(string s) { enum Stub = s; } > mixin Stub!"int x;"; This mixes in `enum Stub s = "int x;";`. The mixed in `Stub` is shadowed by the template of the same name. We can give the mixin a name to go around that: mixin Stub!"int x;" MixedInStub; Then we can print it: void main() { writeln(MixedInStub.Stub); } /* prints "int x;" */ The problem in all this is that dmd allows to mixin a template that's not a `mixin template`. Issue 12298 calls this out. The behavior you're asking for (either behave as string mixin, or fail to compile) is also being asked for in issue 16025. Closing this as a duplicate of 16025. *** This issue has been marked as a duplicate of issue 16025 *** --