Is this a bug? class Foo { const int x; pure void bar() in { int y = x; } body {} } void main() {} DMD 2.054 gives: temp.d(5): Error: pure nested function 'bar' cannot access mutable data 'x' But x isn't even mutable.
I believe this is a rejects-valid. My pull request* to revert the unnecessarily strict purity check allows this. You could also just make `x` immutable instead of const. *: https://github.com/D-Programming-Language/dmd/pull/243
The latest versions of 2.055 give no errors, so I close this bug report.