scope ref T func(scope ref T t) { return t; }

I think this solves the problem.

It doesn't for several reasons:
- You're completely changing the meaning of "scope" for one specific case - This will break DIP25A which only works if scope values cannot be returned - "scope" binds to the function rather than the return type, so in this case is equivalent to making the hidden "this" pointer a "scope" parameter.

Reply via email to