Thread overview
[Issue 15926] Peculiar behavior of 'inout'
Apr 15, 2016
Kenji Hara
Apr 18, 2016
Sobirari Muhomori
Nov 07, 2022
RazvanN
April 15, 2016
https://issues.dlang.org/show_bug.cgi?id=15926

--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> ---
Strongly related enhancement: https://issues.dlang.org/show_bug.cgi?id=13006

--
April 15, 2016
https://issues.dlang.org/show_bug.cgi?id=15926

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com

--- Comment #2 from Steven Schveighoffer <schveiguy@yahoo.com> ---
The issue is that inout local variables are only allowed to be declared inside functions that accept inout parameters.

For example:

void foo()
{
   inout int x; // error
}

Note, this is not a bug, but expected behavior, just not well-explained. However, I think we should remove the limitation, as it causes more problems than it solves.

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

--- Comment #3 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
https://github.com/dlang/phobos/pull/3520 - somewhat related pull to improve concept checks.

--
November 07, 2022
https://issues.dlang.org/show_bug.cgi?id=15926

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |WONTFIX

--- Comment #4 from RazvanN <razvan.nitu1305@gmail.com> ---
This report is not an actual bug report. `inout` is working as expected in this case.

--