Good work on this. It is certainly a problem for Walter if he sticks with his "trust the compiler" philiosphy. Since the DMD documentation claims that foreach should emit optimized code, and it clearly doesn't in these cases, I think you could submit this as a bug. -Craig