Yeah somehow I read that as a question -- must be getting tired.

That makes more sense. 

is there any way to 

On Wed, Jul 19, 2017 at 10:34 PM, Stefan Koch via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
On Wednesday, 19 July 2017 at 12:23:06 UTC, Danni Coy wrote:
On Wed, Jul 19, 2017 at 7:09 PM, Stefan Koch via Digitalmars-d < digitalmars-d@puremagic.com> wrote:


What happens is this.

void open()
{
  foo = () {
  Foo _tmp = Foo.__ctor("test");
  return _tmp;
  } ();
}


Error: need 'this' for 'this' of type 'ref Foo(string s)'

I posted pseudo code to show you that you are creating a temporary.
Which leaves the scope after assigning.
And therefore triggers the destructor.