[Issue 9360] New: Bad error message with non-const template method

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 20 14:00:36 PST 2013


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 at puremagic.com
        ReportedBy: rswhite4 at googlemail.com


--- Comment #0 from rswhite4 at googlemail.com 2013-01-20 14:00:35 PST ---
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: -------


More information about the Digitalmars-d-bugs mailing list