D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3322 - Pure member functions can not call other pure member functions.
Summary: Pure member functions can not call other pure member functions.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2009-09-16 21:37 UTC by Rob Jacques
Modified: 2015-06-09 01:26 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Rob Jacques 2009-09-16 21:37:24 UTC
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.
Comment 1 Don 2010-11-08 19:02:21 UTC
Fixed DMD2.050.