CTFE Status

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 18 10:40:30 PST 2016


On Friday, 18 November 2016 at 17:21:10 UTC, Stefan Koch wrote:
> 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);

Another small update.
I just fixed the bailout mechanism.
Before it would ignore failiures in argument processing and start 
the interpreter with bogus as arguments.
This of course looked like miscompiled code.
I am happy it was just the bailout :)


More information about the Digitalmars-d mailing list