On Saturday, 2 July 2016 at 11:03:16 UTC, qznc wrote:
In general, it is a good idea to make unittests @safe and @nogc in Phobos. When reviewing a pull request, we should check that.

There is a pull request [0] which annotates @system. Why would you do that? Is that somehow a desirable thing? Should a reviewer check for that?

The spec for @system [1] says:

System functions are functions not marked with @safe or @trusted and are not nested inside @safe functions. System functions may be marked with the @system attribute. A function being system does not mean it actually is unsafe, it just means that the compiler is unable to verify that it cannot exhibit undefined behavior.

[0] https://github.com/dlang/phobos/pull/4532
[1] https://dlang.org/spec/function.html#property-functions

What emerged in a previous thread[1], unittests that can't be @safe have to be explicitly marked @system, so that it is obvious to the reader that the functionalities tested are not @safe.

[1] http://forum.dlang.org/thread/[email protected]

Reply via email to