dip1000 and preview in combine to cause extra safety errors

Arafel er.krali at gmail.com
Wed Jun 15 11:22:03 UTC 2022


On 15.06.22 12:49, Dukc wrote:
> This would be outright poison for a stable API or ABI of a library, 
> probably including ARSD. All your public functions have attributes added 
> to them under your nose, and then you cannot change them without 
> breaking client code because it depends on those attributes you did not 
> intend to add.

This.

For this to work, there would need to be some way of saying that, for 
instance, you don't want your function inferred @nogc, even it might be 
in its current implementation (which btw can be just returning "false" 
or throwing "Not implemented yet").

Why? Because you want the actual interface to leave open the possibility 
of needing to allocate later, and if your library isn't overall @nogc, 
why would you want to lock just one function as @nogc?


More information about the Digitalmars-d mailing list