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

           Summary: Not precise error message with failed fixed size array
                    assign
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-10-25 09:57:53 PDT ---
struct Foo {
    char[3] data;
}
int bar(Foo f) {
    return f.data[0];
}
void main() {
    auto f = Foo(['A', 'B']);
}


DMD 2.061alpha:

test.d(8): Error: cannot implicitly convert expression (['A','B']) of type
char[] to char


A better error message is:

test.d(8): Error: cannot implicitly convert expression (['A','B']) of type
char[] to char[4]

Or even something like:

test.d(8): Error: cannot implicitly convert expression (['A','B']) of type
char[] to char[4] ('Foo.data' field)

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

Reply via email to