On 5/7/2011 10:07 PM, Stephan Dilly wrote:
This code  used to work under dmd2.052:

const int[] foo = [1,2,3,4];

void main(string[] argv)
{
    int[] bar = foo;
}

now the compiler says: main.d(30): Error: cannot implicitly convert expression (foo) of type const(int[]) to int[]

but i checked the old behaviour and the compiler made a foo.dup implicitly. was this an intended fix or is it a regression now ? This makes dwt2 not able to compile with the current beta.

I think the new behavior is correct. Putting an automatic .dup in there is a bad idea. This can easily be done explicitly, with minimal added verboseness.
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to