[Issue 251] foreach does not allow updating inside with block

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 24 19:53:09 PDT 2008


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


bugzilla at digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #3 from bugzilla at digitalmars.com  2008-06-24 21:53 -------
This has nothing to do with it being in a with statement.

At one point, the 'key' part of the foreach was set to 'final', meaning it
could not be reassigned. This fell afoul of all the tail const problems, so it
was abandoned.

The current compiler is working as designed. The 'key' value is a mutable copy,
unless it is declared as 'inout'.


-- 



More information about the Digitalmars-d-bugs mailing list