On 5/13/21 3:21 PM, PinDPlugga wrote:

This works but issues a deprecation warning:
```
onlineapp.d(30): Deprecation: returning `this` escapes a reference to parameter `this`
onlineapp.d(30):        perhaps annotate the parameter with `return`
Fraction(1, 3)
```

I found several other ways to make this work without the warnings, but I am wondering how to make this particular case work, or if it is not a recommended way, what the proper way would be.

Just follow the recommendation:

```d
ref Fraction reduce() return { // annotated with return
```

This means, "I will return all or part of the parameter passed in" (the parameter being the `this` reference)

-Steve

Reply via email to