https://issues.dlang.org/show_bug.cgi?id=18094 --- Comment #5 from anonymous4 <dfj1esp02 at sneakemail.com> --- I should note that if assert in the original example is commented, ldc optimizes the whole function away, and the code runs fine, but the collection is not filled. --