www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9360] New: Bad error message with non-const template method

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

           Summary: Bad error message with non-const template method
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: rswhite4 googlemail.com



struct A {
public:
    void test()() {    
    }
}

void main() {
    const A[4] as;
    foreach (index; 0 .. 4) {
        as[index].test();
    }
}

This prints:
/home/c895/c892.d(15): Error: template c892.A.test does not match any function
template declaration. Candidates are:
/home/c895/c892.d(5): c892.A.test()()
/home/c895/c892.d(15): Error: template c892.A.test()() cannot deduce template
function from argument types !()()

It's not easy to understand that you try to call a non-const template method.

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