Change in treatement of array literals

Sean Kelly sean at f4.ca
Fri Jan 18 17:20:20 PST 2008


Previously, this worked just fine:

    int[] buf = [1,2,3,4].dup;

Now, this line gives the error:

    semicolon expected, not '.'

In order to duplicate array literals, they must now be enclosed in parens:

    int[] buf = ([1,2,3,4]).dup;

Is this intended?  And if so, why the change?


Sean


More information about the Digitalmars-d-bugs mailing list