Thread overview
[Issue 18604] in parameter storage class should be deprecated
Mar 13, 2018
Seb
Mar 19, 2018
Adam D. Ruppe
Mar 20, 2018
anonymous4
Mar 20, 2018
anonymous4
Mar 20, 2018
anonymous4
Mar 20, 2018
Jonathan M Davis
Mar 22, 2018
Carsten Blüggel
Mar 30, 2018
anonymous4
May 18, 2020
Mathias LANG
March 13, 2018
https://issues.dlang.org/show_bug.cgi?id=18604

--- Comment #1 from Seb <greensunny12@gmail.com> ---
https://github.com/dlang/dmd/pull/8021

--
March 19, 2018
https://issues.dlang.org/show_bug.cgi?id=18604

Adam D. Ruppe <destructionator@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator@gmail.com

--- Comment #2 from Adam D. Ruppe <destructionator@gmail.com> ---
It never should have been changed from `scope const` in the first place. Anyone who was misusing it is responsible for their own mistake - all written material on the language, from spec to tutorials to books, have been clear from the beginning about what it does and when you are supposed to use it. Their code was already broken.

--
March 20, 2018
https://issues.dlang.org/show_bug.cgi?id=18604

--- Comment #3 from anonymous4 <dfj1esp02@sneakemail.com> ---
(In reply to Seb from comment #0)
> `in` currently just means `const`
That antifeature was only sort of done for safe code, whatever you do, system code shouldn't be affected. Though given how much breakage safe code received lately, I see no reason to not enforce scope for `in` in dip1000 mode, I don't think it can add noticeably more breakage, but postponing it will aggravate the issue.

--
March 20, 2018
https://issues.dlang.org/show_bug.cgi?id=18604

--- Comment #4 from anonymous4 <dfj1esp02@sneakemail.com> ---
Also the reason why safe code receives breakage is because it's invalid, and there should be no guarantee for invalid code to work.

--
March 20, 2018
https://issues.dlang.org/show_bug.cgi?id=18604

--- Comment #5 from anonymous4 <dfj1esp02@sneakemail.com> ---
If one wants to remove `in` attribute the fix is rather simple 's/in/const/'

--
March 20, 2018
https://issues.dlang.org/show_bug.cgi?id=18604

Jonathan M Davis <issues.dlang@jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang@jmdavisProg.co
                   |                            |m

--- Comment #6 from Jonathan M Davis <issues.dlang@jmdavisProg.com> ---
Personally, I don't think that the in keyword on parameters should ever have existed. Having a keyword essentially be an alias for another keyword just creates confusion, and having it be an alias for _two_ keywords is even worse. If someone means const, they should say const. If they mean const scope, they should say const scope. Given the questions asked and discussions had over the years, I think that it's fairly clear that there are plenty of folks who have never understood what the deal with in is and how it relates to const. The fact that it meant two keywords in principle and one in practice just made it worse.

That being said, so many folks liked the idea of in (I think mainly because they conceptually like the idea of it being the counterpoint to out) that a _lot_ of code uses in, and as such, if it were deprecated, a _lot_ of code would have to be changed. So while ideally, I would love to see in deprecated, in practice, I think that it would just break too much code to make sense, as much as that sucks.

--
March 22, 2018
https://issues.dlang.org/show_bug.cgi?id=18604

Carsten Blüggel <chilli@posteo.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chilli@posteo.net

--
March 30, 2018
https://issues.dlang.org/show_bug.cgi?id=18604

--- Comment #7 from anonymous4 <dfj1esp02@sneakemail.com> ---
Another possibility is -transition=in flag that will deprecate `in` on demand, and after people remove usage of `in` storage class from their code, it can start enforce `scope const` meaning.

--
May 18, 2020
https://issues.dlang.org/show_bug.cgi?id=18604

Mathias LANG <pro.mathias.lang@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |pro.mathias.lang@gmail.com
         Resolution|---                         |WONTFIX

--- Comment #8 from Mathias LANG <pro.mathias.lang@gmail.com> ---
`in` has been restored to be `scope const`, albeit with a flag, so WONTFIX.

--