[Issue 9422] New: Missed redundancy of method const error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 29 01:08:21 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9422

           Summary: Missed redundancy of method const error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-01-29 01:08:19 PST ---
>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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list