dip1000 and preview in combine to cause extra safety errors

Steven Schveighoffer schveiguy at gmail.com
Wed Jun 8 21:00:25 UTC 2022


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.

Yes, I know this doesn't mean it catches everything.

There is also something to be said about dip1000 not allowing this even 
for @system code, when it can prove imminent memory corruption.

@system code should not set footguns all over the floor, they should be 
on a back shelf, where you have to go and grab it in order to fire 
southward.

-Steve


More information about the Digitalmars-d mailing list