On Friday, 18 November 2016 at 15:09:02 UTC, Stefan Koch wrote:
I just fixed the bug with multiple ArraysLiterals as arguments.
This means the following code will now compile and properly
execute:
uint Sum3Arrays (uint[] a1, uint[] a2, uint[] a3)
{
uint result;
for(int i; i != a1.length; i++)
{
result += a1[i];
}
for(int i; i != a2.length; i++)
{
result += a2[i];
}
for(int i; i != a3.length; i++)
{
result += a3[i];
}
return result;
}
static assert(Sum3Arrays([2,3],[],[]) == 5);
static assert(Sum3Arrays([2],[],[3]) == 5);
static assert(Sum3Arrays([3],[1],[1]) == 5);