Thread overview
[Issue 22298] [DIP1000] Nested function's scope parameters can be assigned to variables in enclosing function
Jan 12, 2022
Dennis
Jan 13, 2022
Dlang Bot
Jan 14, 2022
Dlang Bot
January 12, 2022
https://issues.dlang.org/show_bug.cgi?id=22298

Dennis <dkorpel@live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |safe, Vision
                 CC|                            |dkorpel@live.nl

--- Comment #1 from Dennis <dkorpel@live.nl> ---
The problem is that `VarDeclaration.enclosesLifetimeOf(VarDeclaration v)` in declaration.d considers parameters to always have a longer lifetime than local variables, without considering if the parameter and local variable actually belong to the same function.

--
January 13, 2022
https://issues.dlang.org/show_bug.cgi?id=22298

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

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

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@dkorpel created dlang/dmd pull request #13530 "Fix issue 22298 - Nested function's scope parameters can be assigned to variables in enclosing function" fixing this issue:

- Fix issue 22298 - Nested function's scope parameters can be assigned to variables in enclosing function

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

--
January 14, 2022
https://issues.dlang.org/show_bug.cgi?id=22298

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

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

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #13530 "Fix issue 22298 - Nested function's scope parameters can be assigned to variables in enclosing function" was merged into master:

- 87226872ebb9d218d21d14350f22748783ac9176 by dkorpel:
  Fix issue 22298 - Nested function's scope parameters can be assigned to
variables in enclosing function

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

--