https://issues.dlang.org/show_bug.cgi?id=15624
--- Comment #1 from Walter Bright <bugzi...@digitalmars.com> --- The foreach delegate is correctly constructed and its @safe-ty is correctly inferred. The overloading of opApply() is correct. The trouble is that the opApply() is selected by inferApplyArgTypes() before the foreach delegate is constructed. --