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

           Summary: Missed implicit cast with fixed size array
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-06-21 12:11:54 PDT ---
void main() {
    int[2][] data1;
    data1.length++;
    int[2] r1 = true ? data1[0] : [0, 0]; // OK, no cast needed

    int[2][][] data2;
    data2.length++;
    int[2][] r2 = true ? data2[0] : [cast(int[2])[0, 0]]; // OK
    int[2][] r3 = true ? data2[0] : [[0, 0]]; // error

    int[2][][][] data3;
    data3.length++;
    int[2][][] r4 = true ? data3[0] : [[cast(int[2])[0, 0]]]; // OK
    int[2][][] r5 = true ? data3[0] : [[[0, 0]]]; // error
}


DMD 2.060alpha:

test.d(9): Error: incompatible types for ((data2[cast(uint)0]) ? ([[0,0]])):
'int[2u][]' and 'int[][]'
test.d(14): Error: incompatible types for ((data3[cast(uint)0]) ? ([[[0,0]]])):
'int[2u][][]' and 'int[][][]'

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

Reply via email to