November 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4090



--- Comment #9 from github-bugzilla@puremagic.com 2012-11-05 01:35:10 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/423b395e24c3cb5ee6387524b40d82ceb16696c2 fix Issue 4090 - more fix for the foreach-range statement

https://github.com/D-Programming-Language/dmd/commit/6d60ced035c322da3a30991b69180a768045b48f Merge pull request #1249 from 9rnsr/fix4090

Additional fix for Issue 4090 - No foreach type inference with const, ref etc modifiers

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4090


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #10 from bearophile_hugs@eml.cc 2012-11-05 04:23:23 PST ---
void main() {
    foreach (const i; 0 .. 10)
        i++;
}


Now it prints both the warning and the error:

test.d(3): Warning: variable modified in foreach body requires ref storage
class
test.d(3): Error: cannot modify const expression i


Closed again. Thank you Hara, Don, yebblies, and others.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4090



--- Comment #11 from bearophile_hugs@eml.cc 2012-11-05 18:56:37 PST ---
void main() {
    int[] array = [10, 20, 30];
    foreach (const i, x; array) {}
    foreach (immutable i, x; array) {}
}


It gives:

test.d(3): Error: cannot modify const expression __key5
test.d(4): Error: cannot modify immutable expression __key7


Do you want me to reopen this bug report?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4090


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


--- Comment #12 from Kenji Hara <k.hara.pg@gmail.com> 2012-11-06 06:27:12 PST ---
(In reply to comment #11)
> void main() {
>     int[] array = [10, 20, 30];
>     foreach (const i, x; array) {}
>     foreach (immutable i, x; array) {}
> }
> 
> 
> It gives:
> 
> test.d(3): Error: cannot modify const expression __key5
> test.d(4): Error: cannot modify immutable expression __key7
> 
> 
> Do you want me to reopen this bug report?

Ouch... sorry, will fix and post the 3rd pull.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4090



--- Comment #13 from bearophile_hugs@eml.cc 2012-11-06 10:47:12 PST ---
(In reply to comment #12)
> Ouch... sorry, will fix and post the 3rd pull.

Thank you Hara. Your new pull request, with a ton of unittests is: https://github.com/9rnsr/dmd/commit/4bc728c24256d11454b580b82a3201e32b8e286d

For my code I write unittests in the same way as you, I try all combinations, in a grid. Because as soon as I miss one combination in the unittests, it sometimes contains a bug :-)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4090



--- Comment #14 from github-bugzilla@puremagic.com 2012-11-07 01:32:44 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4bc728c24256d11454b580b82a3201e32b8e286d 3rd fix of Issue 4090 - No foreach type inference with const, ref etc modifiers

https://github.com/D-Programming-Language/dmd/commit/5b77a1f4f46826562d8785489ac120e1f1753a15 Merge pull request #1261 from 9rnsr/fix4090

3rd fix of Issue 4090 - No foreach type inference with const, ref etc modifiers

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4090


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #15 from bearophile_hugs@eml.cc 2012-11-07 04:47:43 PST ---
Now this code:

void main() {
    int[] array = [10, 20, 30];
    foreach (const i, x; array) i++;
    foreach (immutable i, x; array) i++;
}



Gives:

test.d(3): Warning: variable modified in foreach body requires ref storage
class
test.d(3): Error: cannot modify const expression i
test.d(4): Warning: variable modified in foreach body requires ref storage
class
test.d(4): Error: cannot modify immutable expression i

Why is it giving both the warning and the error?

Closed again. Thank you Hara and others.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 10, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4090



--- Comment #16 from Kenji Hara <k.hara.pg@gmail.com> 2012-11-10 05:10:01 PST ---
(In reply to comment #15)
> Now this code:
> 
> void main() {
>     int[] array = [10, 20, 30];
>     foreach (const i, x; array) i++;
>     foreach (immutable i, x; array) i++;
> }
> 
> 
> 
> Gives:
> 
> test.d(3): Warning: variable modified in foreach body requires ref storage
> class
> test.d(3): Error: cannot modify const expression i
> test.d(4): Warning: variable modified in foreach body requires ref storage
> class
> test.d(4): Error: cannot modify immutable expression i
> 
> Why is it giving both the warning and the error?

Posted a fix-up pull. https://github.com/D-Programming-Language/dmd/pull/1276

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »