[Issue 10982] New: Misleading diagnostic for missing member function overload: "Error: inout method ... is not callable using a const object"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 6 15:21:21 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10982

           Summary: Misleading diagnostic for missing member function
                    overload: "Error: inout method ... is not callable
                    using a const object"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: acehreli at yahoo.com


--- Comment #0 from Ali Cehreli <acehreli at yahoo.com> 2013-09-06 15:21:19 PDT ---
The following struct has two functions, one marked as const and the other
marked as inout. Note that both calls in main are in error: they lack an
argument.

struct S
{
    void is_const(int) const
    {}

    void is_inout(int) inout
    {}
}

void main()
{
    const s = S();
    s.is_const();
    s.is_inout();
}

The error message for the first one is correct because it mentions the
mismatched argument list:

  Error: function deneme.S.is_const (int _param_0) const is not callable using
argument types () const

However, the error message for the second call is misleading:

  Error: inout method deneme.S.is_inout is not callable using a const object

Ali

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list