T[n] a; immutable(T)[n] b = a; // error

Peter Alexander peter.alexander.au at gmail.com
Sun Oct 2 04:17:49 PDT 2011


On 2/10/11 12:44 AM, Steven Schveighoffer wrote:
> On Sat, 01 Oct 2011 08:32:56 -0400, mta`chrono
> <chrono at mta-international.net> wrote:
>
>> int[2] a;
>> immutable(int)[2] b = a.idup;
>
> That should not be necessary. There's no reason to allocate a heap array
> in order to copy data that implicitly casts to immutable.
>
> Definitely a bug.
>
> -Steve

Yep.

Looks like dsimcha beat me to the bug report:

http://d.puremagic.com/issues/show_bug.cgi?id=4454

Up-voted!


More information about the Digitalmars-d mailing list