Yeah, an immutable array of Bar contains an immutable array of int,
whereas mutable would contain mutable, so you can't convert without a
deep dup.

I assume it was fixed by pull 219 for issue 1339.

On Mon, Oct 24, 2011 at 6:03 PM, Nick Sabalausky
<[email protected]> wrote:
> This worked on 2.055, but the 2.056 beta gives "dupImmutable.d(9): Error:
> cannot implicitly convert element type immutable(Bar) to mutable in
> iarr.dup":
>
> struct Bar
> {
>   int[] b;
> }
>
> void main()
> {
>   immutable Bar[] iarr = [];
>   Bar[] arr = iarr.dup;
> }
>
> I *think* that's a bugfix (6695 maybe?) and not a regression, but I wanted
> to double-check.
>
> _______________________________________________
> dmd-beta mailing list
> [email protected]
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to