"Kenji Hara" <[email protected]> wrote in message
news:[email protected]...
>
> This is valid. Because not only strongly pure function will return unique
> object.
>
> For example:
> immutable(int)[] foo(int[] iarr) pure { ... }
> int[] marr = foo([1,2,3]);
> // foo will never return the arr argument (without unsafe cast).
>
This one is incorrect, the value returned from foo could be an immutable
global. The unique conversion is only capable of changing non-mutable to
immutable, not the other way around.
Maybe you meant something like this?
int[] foo(const(int)[] iarr) pure { ... }