<div dir="ltr"><div>The symbols that are introduced by mixin template never override/conflict with the formally defined symbols.</div><div>It's a designed behavior.</div><div><br></div><div>Kenji Hara</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/9/23 growler <span dir="ltr"><<a href="mailto:growlercab@gmail.com" target="_blank">growlercab@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This compiles and runs but I think it is a bug.<br>
---<br>
import std.stdio;<br>
mixin template TestMixin(T) {<br>
    int testMixin;<br>
}<br>
struct Test {<br>
    int testMixin;<br>
    mixin TestMixin!Test;<br>
}<br>
void main() {<br>
    Test t;<br>
    t.testMixin = 10;<br>
    writefln("%s", t);<br>
}<br>
---<br>
$ ./hack<br>
Test(10, 0)<br>
<br>
I can also change the struct to be:<br>
---<br>
struct Test {<br>
   string testMixin;<br>
   mixin TestMixin!Test;<br>
}<br>
// and the assignment in main() to<br>
t.testMixin = "some string";<br>
---<br>
$ ./hack<br>
Test("some string", 0)<br>
<br>
so whether this is a bug or not, I think it is bad. Any thoughts?<span class="HOEnZb"><font color="#888888"><br>
<br>
G.<br>
</font></span></blockquote></div><br></div>