D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10513 - pure overriding method cannot call impure out contract of base class
Summary: pure overriding method cannot call impure out contract of base class
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2013-06-30 11:30 UTC by Henning Pohl
Modified: 2020-03-21 03:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Henning Pohl 2013-06-30 11:30:14 UTC
class C {
    void foo() pure
    out { }
    body { }
}

class D : C {
    override void foo() pure
    { }
}

---
main.d(8): Error: pure function 'main.D.foo' cannot call impure function 'main.C.foo.__ensure'
---
Comment 2 basile-z 2016-07-06 01:51:31 UTC
https://github.com/dlang/dmd/pull/2516