[Issue 15926] Peculiar behavior of 'inout'

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Apr 15 08:28:52 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15926

Steven Schveighoffer <schveiguy at yahoo.com> changed:

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

--- Comment #2 from Steven Schveighoffer <schveiguy at 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.

--


More information about the Digitalmars-d-bugs mailing list