[dmd-beta] 2.056 beta 2: Not a regression, right?

Walter Bright walter at digitalmars.com
Mon Oct 24 00:39:16 PDT 2011



On 10/24/2011 12:03 AM, Nick Sabalausky 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.
>
>

Here iarr.dup is returning an immutable array, which is then attempted to cast 
to the type of arr which is mutable. Hence the error.


More information about the dmd-beta mailing list