Static foreach pull request

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Wed May 10 02:42:53 PDT 2017


On 09.05.2017 23:56, Timon Gehr wrote:
>>
>> core.exception.AssertError at ddmd/blockexit.d(90): Assertion failure
>> ----------------
>> ...
>
> Thanks! (It's a known issue though:
> https://github.com/tgehr/dmd/blob/static-foreach/test_staticforeach.d#L330.)
>

Actually, yours is a different case with the same outcome (f and 
idonotexist do not matter at all, the issue exists even for static 
foreach(j;0..0){}).
All static foreach loops over empty (non-AliasSeq) aggregates failed 
that assertion. The reason was that CTFE can return a null literal from 
a function that returns T[], but the constant folder cannot actually 
evaluate null.length for some reason.


More information about the Digitalmars-d mailing list