inout auto ref escaping a reference to parameter, only errors with vibe Json type, or if inout is there.

aliak something at something.com
Tue Mar 12 16:11:58 UTC 2019


On Monday, 11 March 2019 at 22:29:05 UTC, aliak wrote:
> Hi,
>
> I have an error that says "Error: returning `match1(opt)` 
> escapes a reference to parameter `opt`, perhaps annotate with 
> `return`".
>
> [...]

Ok, I've found out something else. It only happens when you're 
returning a type that has an indirection. So instead of the Json 
type if we returned an S type where S was:

struct S {
   void[2] data;
}

We get the same error.



More information about the Digitalmars-d-learn mailing list