www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Change in treatement of array literals

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?

Jan 18 2008