Bug 3322 – Pure member functions can not call other pure member functions.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-09-16T21:37:00Z
Last change time
2015-06-09T01:26:48Z
Keywords
rejects-valid
Assigned to
nobody
Creator
sandford

Comments

Comment #0 by sandford — 2009-09-16T21:37:24Z
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 by clugdbug — 2010-11-08T19:02:21Z
Fixed DMD2.050.