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

RazvanN <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from RazvanN <[email protected]> ---
How about letting void initialization be acceptable in @safe code only if the
value is initialized before being used? In the example from the bug report, the
code would error since x is returned before being initialized. But this should
be acceptable @safe code:

int f() @safe
{
    int x = void;
    do_some_work();
    x = 7;
    return x;
}

That would imply an AST walker for the current scope to see if x is initialized
anywhere.

--

Reply via email to