Are @safe unittests actually checked for safety?

Adam D. Ruppe destructionator at
Mon Sep 7 23:47:51 UTC 2020

On Monday, 7 September 2020 at 20:33:26 UTC, 0xEAB wrote:
> Are unittests that are marked @safe actually checked for safety?
> How comes this unittest is @safe when `dirEntries` appears to 
> be @system?

I see what happened now: those nested functions are defined, but 
never actually called.

The definition did NOT inherit the @safe from the unittest, but 
since they were never called, it never actually mattered; the 
check happens on call, not on definition.

More information about the Digitalmars-d-learn mailing list