From this thread: http://forum.dlang.org/thread/dqoeyvvzyuuvvkiqdbtv@forum.dlang.org class Foo { int[] array; const int[] bar() const { return array; } } void main() {} DMD 2.062alpha gives: test.d(4): Error: cannot implicitly convert expression (this.array) of type const(int[]) to int[] But I'd like a more clear error message like: test.d(3): Error: redundant qualifier const on class method Foo.bar
See also closed Issue 4070
(In reply to comment #0) > test.d(3): Error: redundant qualifier const on class method Foo.bar I think this would be clearer wording: test.d(3): Error: more than one const qualifier on class method Foo.bar
https://github.com/D-Programming-Language/dmd/pull/3696