Thread overview
[Issue 23985] [dip1000] return scope fails to infer after assignment
Jun 11, 2023
timon.gehr@gmx.ch
Jun 11, 2023
timon.gehr@gmx.ch
Jun 11, 2023
Dennis
June 11, 2023
https://issues.dlang.org/show_bug.cgi?id=23985

timon.gehr@gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr@gmx.ch

--- Comment #1 from timon.gehr@gmx.ch ---
Do we really want `scope` inference on virtual methods? The code type checks without deprecation if you mark both methods as `final`.

--
June 11, 2023
https://issues.dlang.org/show_bug.cgi?id=23985

--- Comment #2 from timon.gehr@gmx.ch ---
If inferring `return scope` on `a` was not the intention, can you maybe clarify how a fix for this issue would work?

--
June 11, 2023
https://issues.dlang.org/show_bug.cgi?id=23985

--- Comment #3 from Dennis <dkorpel@live.nl> ---
(In reply to timon.gehr from comment #1)
> Do we really want `scope` inference on virtual methods?

Good point, I missed that the method is virtual. I think this would be invalid then. (Though of course the enhancement for separate lifetimes for separate aggregate fields still stands)

--