Bug 13567 – Attribute inference for private functions

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-10-02T03:22:56Z
Last change time
2024-12-13T18:30:31Z
Assigned to
No Owner
Creator
Daniel Nielsen
See also
https://issues.dlang.org/show_bug.cgi?id=16138, https://issues.dlang.org/show_bug.cgi?id=20786
Moved to GitHub: dmd#18895 →

Comments

Comment #0 by goxryz — 2014-10-02T03:22:56Z
Previously attribute inference was considered for all auto functions, but there was no consensus reached. Using attribute inference for private functions avoids all previously raised concerns except "slows down compilation". Walter: "Please file as an enhancement request. The more attribute inference we can do, the better."
Comment #1 by hsteoh — 2014-10-02T03:38:30Z
I agree with this. Private functions don't suffer from the same objections raised against adding inference to auto functions, so perhaps this is the way to go to increase the scope of attribute inference in D.
Comment #2 by bugzilla — 2015-08-12T03:15:06Z
Example: private void bar() { } void foo() @safe { bar(); } should work.
Comment #3 by petar.p.kirov — 2015-08-12T09:47:35Z
Walter, so you agree that private functions should get attribute inference, like auto retrning functions?
Comment #4 by code — 2015-08-12T13:14:20Z
It would be a good step forward to less attribute clutter.
Comment #5 by petar.p.kirov — 2015-08-13T07:14:00Z
Yes, it would definitely be a step in the right direction. A lot more code will benefit from this because private functions are more common than auto-returning and also people tend to neglect putting attributes on private functions more than on public ones.
Comment #6 by petar.p.kirov — 2017-07-01T11:43:48Z
*** Issue 16138 has been marked as a duplicate of this issue. ***
Comment #7 by robert.schadek — 2024-12-13T18:30:31Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18895 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB