[Issue 3322] New: Pure member functions can not call other pure member functions.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 16 21:37:24 PDT 2009


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: nobody at puremagic.com
        ReportedBy: sandford at jhu.edu


--- Comment #0 from Rob Jacques <sandford at 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: -------


More information about the Digitalmars-d-bugs mailing list