https://issues.dlang.org/show_bug.cgi?id=16138

          Issue ID: 16138
           Summary: Attributes of private functions should be inferred
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: bugzi...@digitalmars.com

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.

--

Reply via email to