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

           Summary: Pure member functions can not call other pure member
                    functions.
           Product: D
           Version: 2.032
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: sandf...@jhu.edu


--- Comment #0 from Rob Jacques <sandf...@jhu.edu> 2009-09-16 21:37:24 PDT ---
Member functions marked as pure can not be called from other pure functions. 

struct foo {
    real a() pure {
        return 1.0;
    }
    real b() pure {
        return a; // Error on this line
    }
}

Error: function main.foo.a () is not callable using argument types ()

Marking a() as pure const allows code to compile, and produces correct results.

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

Reply via email to