https://issues.dlang.org/show_bug.cgi?id=22792
--- Comment #3 from [email protected] --- Same behaviour without the first parameter that is identical for every overload: struct S { int opApply(int delegate(ref int) dg) { puts("mutable int"); return 0; } int opApply(int delegate(ref const(int)) dg) const { puts("const int"); return 0; } int opApply(int delegate(ref string) dg) { puts("mutable str"); return 0; } int opApply(int delegate(ref const(string)) dg) const { puts("const str"); return 0; } } void main() { S s; foreach (ref const(int) y; s) {} foreach (ref const(string) y; s) {} const S s2; foreach (ref const(int) y; s2) {} foreach (ref const(string) y; s2) {} } --
