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

           Summary: foreach on matrix literal refuses immutable iteration
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from [email protected] 2013-08-24 08:55:18 PDT ---
A matrix literal can be assigned to an immutable, but this isn't done in a
foreach:


void main() {
    immutable m1 = [[1]]; // OK
    foreach (immutable v; [[1]]) {} // error
}


dmd 2.064alpha gives:

test.d(3): Error: cannot implicitly convert expression (__aggr4[__key5]) of
type int[] to immutable(int[])

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

Reply via email to