@safe D requires which DIP switches?

Dennis dkorpel at gmail.com
Fri Jan 7 09:47:33 UTC 2022


On Friday, 7 January 2022 at 08:39:25 UTC, Atila Neves wrote:
> You *can*, but it's likely that the vast majority of code 
> *won't*. Changing this would break a lot of code, as seen by 
> your attempts to fix Phobos.
>
> Another option ...

I don't see a first option in your first paragraph. "it's likely 
that the vast majority of code *won't*", sure, but scope 
inference needs to be 100%, 'likely `scope`' is not useful 
information for DMD.

> Another option is making it so pure functions can't throw, but 
> that also probably introduces a lot of breakage.

`pure` `nothrow` functions don't break, it's only `pure` 
functions that throw exceptions that lose their free `scope` 
inference. Disallowing `pure` `throw` functions entirely results 
in a strict superset of the breakage, on top of adding an 
arbitrary restriction to users.


More information about the Digitalmars-d mailing list