Thread overview
[dmd-beta] dmd 1.071 and 2.056 beta 2
Oct 24, 2011
Walter Bright
Oct 24, 2011
Nick Sabalausky
[dmd-beta] 2.056 beta 2: Not a regression, right?
Oct 24, 2011
Nick Sabalausky
Oct 24, 2011
Daniel Murphy
Oct 24, 2011
Walter Bright
October 23, 2011
http://ftp.digitalmars.com/dmd1beta.zip http://ftp.digitalmars.com/dmd2beta.zip
October 24, 2011
I'm still getting the std.regex errors. The offending uses of writef/writefln are all inside the 'printProgram' function that starts at line 1161.

October 24, 2011
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.

October 24, 2011
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 <bus_dmdbeta at semitwist.com> 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
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
October 24, 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.