www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17766] New: Wrong choice of generic mutable/const/immutable


          Issue ID: 17766
           Summary: Wrong choice of generic mutable/const/immutable
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ilyayaroshenko 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!()())[]);


But shuold be


Type qualifier should have priority.

Aug 19 2017