Discussion Thread: DIP 1028--Make @safe the Default--Final Review

Walter Bright newshound2 at digitalmars.com
Fri Mar 27 09:07:01 UTC 2020


On 3/26/2020 9:20 PM, Mathias Lang wrote:
> Take any library that accepts a delegate: Either one has to restrict what the 
> delegate can do, or make a certain attribute un-enforceable. There's no way to 
> write an interface that concisely expresses that its `@safe`ty, `@nogc`-ness or 
> `nothrow`-ness depends on the user-provided delegate, unless you template 
> absolutely everything, which is not a viable (and sometimes, not possible) 
> solution.

Making @safe the default will substantially reduce this problem for the simple 
reason that the vast bulk of code should be @safe.

BTW, I have an upcoming DIP that changes the default attributes for delegate 
parameter types to match the function they appear in.


More information about the Digitalmars-d mailing list