<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2012/3/27 Daniel Donnelly <span dir="ltr"><<a href="mailto:enjoysmath@gmail.com" target="_blank">enjoysmath@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I have: [code]<br>
<br>
     module A;<br>
        module A;<br>
<br>
        interface B {<br>
           public:<br>
                  immutable B dup();<br>
        }<br>
<br>
        class A : B {<br>
           public:<br>
                  this() {}<br>
                  this(in char[] field) { this.field = field.dup; }<br>
                  immutable A dup() { return new A(field); }<br>
           private:<br>
                  char[] field;<br>
        }<br>
<br>
        void main()<br>
        {<br>
                B f, g;<br>
                f = new A;<br>
                g = new A;<br>
                <br>
                f = g.dup;<br>
        }<br></blockquote><div><br></div><div>With git head (2.062alpha):</div><div><br></div><div>test.d(21): Error: immutable method test.B.dup is not callable using a mutable object</div><div><br></div><div>Kenji Hara </div>
</div><br></div></div>