The following should work:
----------------------
private void bar() { }
@safe void foo()
{
bar();
}
----------------------
dmd test
test.d(6): Error: safe function 'test5.foo' cannot call system function 'test.bar'
-----------------------
because attributes for private functions with bodies can be safely inferred, as they don't have external linkage issues.
Comment #1 by petar.p.kirov — 2017-07-01T11:43:48Z
*** This issue has been marked as a duplicate of issue 13567 ***