[Issue 8893] [ICE][CTFE] (interpret.c, line 3598) with failed array access

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 30 06:01:44 PDT 2012


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



--- Comment #4 from bearophile_hugs at eml.cc 2012-10-30 06:01:42 PDT ---
struct Foo {
    char[3] data;
}
int bar(Foo f) {
    return f.data[0];
}
void main() {
    enum f = Foo(['A', 'B']);
    enum int b = bar(f);
}


The error message seems not correct:

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


Instead of:

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

-- 
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