[Issue 9212] New: Associative array foreach iteration with immutable key

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 26 15:02:57 PST 2012


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 at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-12-26 15:02:57 PST ---
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: -------


More information about the Digitalmars-d-bugs mailing list