Call to Action: making Phobos @safe

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 25 23:49:51 PDT 2016


On Sunday, June 26, 2016 06:29:05 Tourist via Digitalmars-d wrote:
> On Saturday, 25 June 2016 at 22:56:12 UTC, Walter Bright wrote:
> > On 6/25/2016 3:44 PM, Walter Bright wrote:
> >> 4. Add @safe to the unittest
> >
> > A unittest that is deliberately unsafe should be annotated with
> > @system. Meaning that any un-annotated unittest needs
> > corrective action one way or the other.
>
> So why not declare @safe module-wise, and only add @system
> annotations where needed?

In general, IMHO, mass applying attributes is a bad idea, because it makes
it harder to know which attributes apply where, which is a maintenance
problem. However, even worse than that, while there it _is_ possible to
apply @safe to the module as a whole and then selectively apply @trusted and
@system explicitly, there is no way to turn off all of the @safety
attributes so that attribute inference can be used. And other attributes
can't be undone at all. So, if you have templates in a module, mass applying
attributes is a disaster.

- Jonathan M Davis



More information about the Digitalmars-d mailing list