Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute inference for private functions #18895

Open
dlangBugzillaToGithub opened this issue Oct 2, 2014 · 6 comments
Open

Attribute inference for private functions #18895

dlangBugzillaToGithub opened this issue Oct 2, 2014 · 6 comments

Comments

@dlangBugzillaToGithub
Copy link

Daniel Nielsen reported this on 2014-10-02T03:22:56Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=13567

CC List

Description

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."
@dlangBugzillaToGithub
Copy link
Author

hsteoh commented on 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.

@dlangBugzillaToGithub
Copy link
Author

bugzilla (@WalterBright) commented on 2015-08-12T03:15:06Z

Example:

  private void bar() { }

  void foo() @safe {
    bar();
  }

should work.

@dlangBugzillaToGithub
Copy link
Author

petar.p.kirov commented on 2015-08-12T09:47:35Z

Walter, so you agree that private functions should get attribute inference, like auto retrning functions?

@dlangBugzillaToGithub
Copy link
Author

code (@MartinNowak) commented on 2015-08-12T13:14:20Z

It would be a good step forward to less attribute clutter.

@dlangBugzillaToGithub
Copy link
Author

petar.p.kirov commented on 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.

@dlangBugzillaToGithub
Copy link
Author

petar.p.kirov commented on 2017-07-01T11:43:48Z

*** Issue 16138 has been marked as a duplicate of this issue. ***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant