www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9212] New: Associative array foreach iteration with immutable key

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

           Summary: Associative array foreach iteration with immutable key
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



I think this code should be accepted:


void main() {
    int[int] aa;
    foreach (const key, val; aa) {}
}



DMD 2.061alpha gives:

test.d(3): Error: foreach: index must be type int, not const(int)

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