Bug 10981 – Contracts in pure class methods are useless
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-06T11:29:00Z
Last change time
2015-02-18T03:37:33Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
henning
Comments
Comment #0 by henning — 2013-09-06T11:29:40Z
This regression was my fault, sorry for that: https://github.com/D-Programming-Language/dmd/pull/2516
I can't believe it passed the test suite:
class C
{
void foo(int i) pure
in { assert(i); }
body { }
}
---
main.d(4): Error: pure nested function '__require' cannot access mutable data 'i'
---