www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13011] New: inout delegate parameter cannot receive exactly

https://issues.dlang.org/show_bug.cgi?id=13011

          Issue ID: 13011
           Summary: inout delegate parameter cannot receive exactly same
                    type argument
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

Test case:

size_t hashOf(int delegate() inout val)
{
    return 0;
}
void main()
{
    int delegate() inout dg;
    auto h = hashOf(dg);
}

Output:

test.d(8): Error: cannot implicitly convert expression (dg) of type int
delegate() inout to int delegate() const

--
Jun 30 2014