Created attachment 875 [details] Code demonstrating the issue An object typed as const will have const members, and a class declared as const will have const members, but a class typed as const does not have const members.
The example code in attachment is: import std.stdio; class A { int b; } void main() { const A a = new A; writeln(typeof(a).stringof); // const(A) writeln(typeof(a.b).stringof); // const(int) writeln((const A).stringof); // const(A) writeln(typeof((const A).b).stringof); // int, should be const(int) }
https://github.com/D-Programming-Language/dmd/pull/903
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/94c3a15d6b267ca7ad314482813dfa74e4b55b3f fix Issue 5473 - Members of const-qualified classes are not const themselves https://github.com/D-Programming-Language/dmd/commit/e2c9bfa15882994a4fef9f20532797d42e887379 Merge pull request #903 from 9rnsr/fix5473 Issue 5473 - Members of const-qualified classes are not const themselves