<div dir="ltr">2013/11/10 Daniel Murphy <span dir="ltr"><<a href="mailto:yebblies@nospamgmail.com" target="_blank">yebblies@nospamgmail.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
"Kenji Hara" <<a href="mailto:k.hara.pg@gmail.com">k.hara.pg@gmail.com</a>> wrote in message<br>
news:mailman.336.1384083327.9546.digitalmars-d@puremagic.com...<br>
<div class="im">><br>
> This is valid. Because not only strongly pure function will return unique<br>
> object.<br>
><br>
</div><div class="im">> For example:<br>
>  immutable(int)[] foo(int[] iarr) pure { ... }<br>
>  int[] marr = foo([1,2,3]);<br>
>  // foo will never return the arr argument (without unsafe cast).<br>
><br>
<br>
</div>This one is incorrect, the value returned from foo could be an immutable<br>
global.  The unique conversion is only capable of changing non-mutable to<br>
immutable, not the other way around.<br></blockquote><div><br></div><div>foo is pure, so it cannot return "immutable global".</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Maybe you meant something like this?<br>
<br>
int[] foo(const(int)[] iarr) pure { ... }<br></blockquote><div><br></div><div>Of course, both your case and mine are valid.</div><div><br></div><div>Kenji Hara</div></div></div></div>