Bug 9422 – Missed redundancy of method const error
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-29T01:08:19Z
Last change time
2022-09-08T14:04:55Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2013-01-29T01:08:19Z
From this thread:
http://forum.dlang.org/thread/[email protected]
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
Comment #1 by bearophile_hugs — 2013-01-29T01:43:33Z
See also closed Issue 4070
Comment #2 by tommitissari — 2013-01-29T02:24:54Z
(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