dip1000 and preview in combine to cause extra safety errors
Dukc
ajieskola at gmail.com
Wed Jun 8 22:03:05 UTC 2022
On Wednesday, 8 June 2022 at 21:00:25 UTC, Steven Schveighoffer
wrote:
> On 6/8/22 4:49 PM, Dukc wrote:
>
>> The philosophy is to force to be explicit in the simplest
>> cases that are almost always errors, but not trying to
>> seriously prevent the escape.
>
> This is the same case. You are returning what is a a reference
> to a scope (local) variable, directly.
I suppose you're right, that would be good if it errored.
In fact, I'm surprised the compiler does not siletly add
`return`. I did complain about silent adding of `return` in a
fairly similar function here:
https://forum.dlang.org/thread/edtbjavjzkwogvutxpho@forum.dlang.org
I did initially advocate for compiling without adding `return`
but as your example demonstrates an error would be better.
More information about the Digitalmars-d
mailing list