Is @safe still a work-in-progress?

Walter Bright newshound2 at digitalmars.com
Sat Aug 25 02:28:25 UTC 2018


On 8/23/2018 8:14 AM, Steven Schveighoffer wrote:
> If I had to design a specific way to allow the common case to be easy, but still 
> provide a mechanism for the uncommon cases, I would say:
> 
> 1. define a compiler-recognized attribute (e.g. @__sink).
> 2. If @__sink is applied to any parameter, that is effectively the return value.
> 3. In the absence of a @__sink designation on non-void-returning functions, it 
> applies to the return value.
> 4. In the absence of a @__sink designation on void returning functions, it 
> applies to the first parameter.
> 5. Inference of @__sink happens even on non-templates.
> 6. If @__sink is attributed on multiple parameters, you assume all return 
> parameters are assigned to all @__sink parameters for the purposes of verifying 
> lifetimes are not exceeded.


'ref' is already @__sink.


More information about the Digitalmars-d mailing list