https://issues.dlang.org/show_bug.cgi?id=17049
--- Comment #7 from Martin Nowak ---
And this is supposed to not work?
struct Handle { int a; }
static @safe Handle get2(return ref scope S _this)
{
return Handle(1);
}
struct S
{
}
Handle escape() @safe
{
S s;
auto h =
https://issues.dlang.org/show_bug.cgi?id=17049
--- Comment #6 from Martin Nowak ---
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; }
https://issues.dlang.org/show_bug.cgi?id=17049
--- Comment #5 from Martin Nowak ---
(In reply to Martin Nowak from comment #4)
> return ps1; // works
silenty escapes !!!
> // return ps2; // doesn't work
correctly errors on escape !!!
> }
--
https://issues.dlang.org/show_bug.cgi?id=17049
--- Comment #4 from Martin Nowak ---
There is a difference from member functions to free function.
static @safe S* get2(return ref scope S _this)
{
return &_this;
}
struct S
{
@safe S* get1() return scope
{
return
https://issues.dlang.org/show_bug.cgi?id=17049
Martin Nowak changed:
What|Removed |Added
Status|RESOLVED|REOPENED
https://issues.dlang.org/show_bug.cgi?id=17049
Walter Bright changed:
What|Removed |Added
Status|NEW |RESOLVED
https://issues.dlang.org/show_bug.cgi?id=17049
--- Comment #1 from Martin Nowak ---
No longer works (not even for int*) with dmd-master-2017-01-04 and -dip1000.
--
https://issues.dlang.org/show_bug.cgi?id=17049
Martin Nowak changed:
What|Removed |Added
Keywords||safe
--
https://issues.dlang.org/show_bug.cgi?id=17049
Martin Nowak changed:
What|Removed |Added
Hardware|x86_64 |All
OS|Linux