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

--- Comment #6 from Martin Nowak <c...@dawg.eu> ---
And the same is supposed to work for foreign pointers?

static @safe float* get2(return ref scope S _this)
{
    return convert(&_this);
}

@trusted float* convert(S* s) { return cast(float*)s; }

struct S
{
}

float* escape() @safe
{
    S s;
    auto pf = s.get2();
    return pf; // works
}
----
Error: scope variable pf may not be returned
----

--

Reply via email to