digitalmars.D.learn - DIP1000: Should this compile
- Max Haughton (3/3) May 16 2019 https://run.dlang.io/is/cKFsXh
- Steven Schveighoffer (5/10) May 16 2019 Answer to subject: no. This is a bug. Please file.
- Max Haughton (7/18) May 16 2019 The parameter pointer outlives the the &local, i.e. cannot be
- Simen =?UTF-8?B?S2rDpnLDpXM=?= (6/9) May 16 2019 This is a bug, as can be showed by repeating the call to
https://run.dlang.io/is/cKFsXh Should this compile, or is return scope T* down to the user to not escape (Returning &local directly does not compile)
May 16 2019
On 5/16/19 10:21 PM, Max Haughton wrote:https://run.dlang.io/is/cKFsXh Should this compile, or is return scope T* down to the user to not escape (Returning &local directly does not compile)Answer to subject: no. This is a bug. Please file. Not sure what the solution is, because dip1000 makes scope a storage class. So there's no way to tag what the input parameter points at. -Steve
May 16 2019
On Thursday, 16 May 2019 at 21:56:52 UTC, Steven Schveighoffer wrote:On 5/16/19 10:21 PM, Max Haughton wrote:The parameter pointer outlives the the &local, i.e. cannot be guaranteed that it doesn't escape, which is sufficient grounds to not allow the assignment. Hopefully, this is a implementation rather specification error (If my understanding of the DIP is correct)https://run.dlang.io/is/cKFsXh Should this compile, or is return scope T* down to the user to not escape (Returning &local directly does not compile)Answer to subject: no. This is a bug. Please file. Not sure what the solution is, because dip1000 makes scope a storage class. So there's no way to tag what the input parameter points at. -Steve
May 16 2019
On Thursday, 16 May 2019 at 21:21:51 UTC, Max Haughton wrote:https://run.dlang.io/is/cKFsXh Should this compile, or is return scope T* down to the user to not escape (Returning &local directly does not compile)This is a bug, as can be showed by repeating the call to (*boi).writeln - suddenly the output changes between calls. Filed: https://issues.dlang.org/show_bug.cgi?id=19881 -- Simen
May 16 2019