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

Walter Bright <[email protected]> changed:

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

--- Comment #3 from Walter Bright <[email protected]> ---
If we replace the struct with an equivalent pointer:

@safe void check()
{
    int random;

    auto createGenerator() {
        int* p = &random;
        return p;
    }

    scope gen = createGenerator;
}

it does compile successfully. Both should compile successfully, as the struct
is just a wrapper around a pointer.

--

Reply via email to