On Friday, 14 April 2023 at 11:18:21 UTC, Dennis wrote:
On Friday, 14 April 2023 at 10:31:58 UTC, kdevel wrote:
But in fact it is returned unless it is `return ref`.

When using `return ref`, `return scope`, `scope` etc., you should be using the latest compiler and annotate functions you want checked with `@safe`.

We are writing at cross puroposes. I am not asking how I could help the compiler. My point is: I have code from 2019 which produced a deprecation warning

```
returnref2.d(3): Deprecation: returning i escapes a reference to parameter i, perhaps annotate with return
```

when compiled with with the compiler of that time (v2.093.1). When I use a recent compiler (v2.102.2) the code compiles without any complaints. I am asking myself what has deprecacted? I mean: Deprecation notes are built into the compiler in order to enable a "soft landing" for a scheduled breaking change. But I cannot see any breaking change at all regarding the code example in

https://forum.dlang.org/post/iysfuhjwyalnnmalb...@forum.dlang.org

  • Returning a refe... Chris Katko via Digitalmars-d-learn
    • Re: Returni... IchorDev via Digitalmars-d-learn
    • Re: Returni... Paul Backus via Digitalmars-d-learn
    • Re: Returni... Jacob Shtokolov via Digitalmars-d-learn
      • Re: Ret... kdevel via Digitalmars-d-learn
        • Re:... Bastiaan Veelo via Digitalmars-d-learn
          • ... kdevel via Digitalmars-d-learn
            • ... Dennis via Digitalmars-d-learn
              • ... kdevel via Digitalmars-d-learn
                • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
                • ... kdevel via Digitalmars-d-learn
                • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
                • ... kdevel via Digitalmars-d-learn
                • ... Dennis via Digitalmars-d-learn
                • ... Dennis via Digitalmars-d-learn
                • ... kdevel via Digitalmars-d-learn
                • ... Dennis via Digitalmars-d-learn
                • ... kdevel via Digitalmars-d-learn
                • ... Dennis via Digitalmars-d-learn

Reply via email to