https://issues.dlang.org/show_bug.cgi?id=22792
--- Comment #2 from [email protected] --- Slightly modified test case: import core.stdc.stdio; struct S { int opApply(int delegate(ref const(int), ref int) dg) { puts("mutable int"); return 0; } int opApply(int delegate(ref const(int), ref const(int)) dg) const { puts("const int"); return 0; } int opApply(int delegate(ref const(int), ref string) dg) { puts("mutable str"); return 0; } int opApply(int delegate(ref const(int), ref const(string)) dg) const { puts("const str"); return 0; } } void main() { S s; foreach (ref const(int) x, ref const(int) y; s) {} foreach (ref const(int) x, ref const(string) y; s) {} const S s2; foreach (ref const(int) x, ref const(int) y; s2) {} foreach (ref const(int) x, ref const(string) y; s2) {} } Up to 2.074.1: Success with output: ----- const int const str const int const str ----- Since 2.075.1: Success with output: ----- const int mutable str const int const str ----- --
