Properties for unittests

qznc via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 2 04:03:16 PDT 2016


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


More information about the Digitalmars-d mailing list