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 #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