Thread overview
[Issue 19566] Warn when the same argument is passed two times, once as ref or out, the other not
Jan 11, 2019
RazvanN
Apr 15, 2019
Basile-z
Apr 16, 2019
apham
January 11, 2019
https://issues.dlang.org/show_bug.cgi?id=19566

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> ---
This will most likely be marked as invalid. The reasons are:

1. Walter is against warnings. His position, to which I adhere, is that the compiler should either emit an error or accept the code. Anything in between is speculation and it depends on what you want to do with your code.

2. There is no way that the code in the bug report will error. That is valid code.

3. The check for the general case will come with a performance cost for a niche case.

4. It is a job for static analysis tools to warn us on such code smells, not that of a compiler.

I suggest we close this as invalid.

--
April 15, 2019
https://issues.dlang.org/show_bug.cgi?id=19566

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--
April 16, 2019
https://issues.dlang.org/show_bug.cgi?id=19566

apham <apz28@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |apz28@hotmail.com

--- Comment #2 from apham <apz28@hotmail.com> ---
This should be an error as below


```
void stuff(I,O)(const I input, out O output){}

void other()
{
    ubyte[] data = void;
    stuff(data, data);
}
```

--