Thread overview
[Issue 20369] shadowed variable in foreach loop always considered "foreach variable"
Nov 19, 2019
RazvanN
Nov 19, 2019
Rainer Schuetze
Nov 24, 2019
RazvanN
Apr 18, 2023
RazvanN
Dec 20
Dlang Bot
Jan 01
Dlang Bot
November 19, 2019
https://issues.dlang.org/show_bug.cgi?id=20369

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> ---
I'm not sure I understand this bug report. Is it because the variable inside the foreach loop is referred to as a foreach variable? You would expect something along the lines of "Rename the variable in the foreach body"?

--
November 19, 2019
https://issues.dlang.org/show_bug.cgi?id=20369

--- Comment #2 from Rainer Schuetze <r.sagitario@gmx.de> ---
I consider "k" and "v" to be the "foreach variables", not any local variable elsewhere. I don't expect that the compiler tells me that the variable is declared inside the body of a foreach,while,if or similar.

--
November 24, 2019
https://issues.dlang.org/show_bug.cgi?id=20369

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |bootcamp

--
April 18, 2023
https://issues.dlang.org/show_bug.cgi?id=20369

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |trivial

--
December 20
https://issues.dlang.org/show_bug.cgi?id=20369

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@eoan-ermine created dlang/dmd pull request #15934 "Fix issue 20369 - shadowed variable in foreach loop always considered "foreach variable"" fixing this issue:

- Fix issue 20369 - shadowed variable in foreach loop always considered "foreach variable"

  Remove unintuitive phrase in deprecation message

https://github.com/dlang/dmd/pull/15934

--
January 01
https://issues.dlang.org/show_bug.cgi?id=20369

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15934 "Fix issue 20369 - shadowed variable in foreach loop always considered "foreach variable"" was merged into master:

- 8f9476e762b3de323ea86b72a621b8ee92cd6778 by Danil Sidoruk:
  Fix issue 20369 - shadowed variable in foreach loop always considered
"foreach variable"

  * Remove unintuitive phrase in deprecation message
  * Fix deprecation message in test

https://github.com/dlang/dmd/pull/15934

--