On Saturday, 7 July 2018 at 18:48:35 UTC, Mr.Bingo wrote: > The enums are local in nature and are used to store > intermediate results but the looping tries to redefine them, > which gives an error. Have you tried putting a second set of {} around it? static foreach(...) {{ // 2 intentional enum y = whatever; }} // 2 intentional ?