https://issues.dlang.org/show_bug.cgi?id=17766
Issue ID: 17766 Summary: Wrong choice of generic mutable/const/immutable methods Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: ilyayaroshe...@gmail.com static struct Foo() { char opIndex(Indexes...)(Indexes indexes) immutable { return 'i'; } char opIndex()() const { return 'c'; } char opIndex(Indexes...)(Indexes indexes) { return 'm'; } } pragma(msg, Foo!()()[]); pragma(msg, (cast(const) Foo!()())[]); pragma(msg, (cast(immutable) Foo!()())[]); Prints 'c' 'c' 'c' But shuold be 'm' 'c' 'i' Type qualifier should have priority. --