[Issue 9140] New: ref foreach of immutables in postcondition

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 10 20:46:39 PST 2012


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

           Summary: ref foreach of immutables in postcondition
           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-10 20:46:32 PST ---
immutable(int)[] bar()
out(result) {
    foreach (ref r; result) {}
} body {
    return null;
}
void main() {}


I think the error is not correct, DMD 2.061alpha gives:

test.d(3): Error: variable test.bar.result cannot modify result 'result' in
contract

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