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

Public, Private and Protected Access Modifiers #3289

Closed
offensive-penetrator opened this issue Aug 18, 2023 · 1 comment
Closed

Public, Private and Protected Access Modifiers #3289

offensive-penetrator opened this issue Aug 18, 2023 · 1 comment
Labels
request Requests to resolve a particular developer problem state-duplicate This issue or pull request already exists

Comments

@offensive-penetrator
Copy link

offensive-penetrator commented Aug 18, 2023

Please add this to the language, because I'm done with that.
If I'll get no fair response, I'll just move on to another language.

And thanks for all of the supporters.

@lrhn lrhn transferred this issue from dart-lang/sdk Aug 18, 2023
@lrhn
Copy link
Member

lrhn commented Aug 18, 2023

If your problem is that you don't like writing _s in front of names, then I will suggest finding another language.
We have no current active plans to change that. We might, in the depth of time, but that can be said about anything.
And it's been discussed for a long time, e.g., in dart-lang/sdk#33383 or #1446. Nothing has changed.

If there is something you want to do with public or private declarations, that you cannot achieve with Dart's existing public (default) or library private (_-named) access control, I'd like to know what that is. If anything, having a declaration be private to its compilation unit is more flexible than just private to a single class. After all, you can always put a single class into each library, and then library privacy is class privacy.

The access control that Dart is actually missing is protected, and I do miss it too.
But again, while we are always pondering if there is something we can do about it, it's not currently considered a high priority.
Look at any of: #2571, #1026, #835, #757 for ideas.
(Personally, as someone who writes libraries for others to extend and who could use protected, I'd still rather spend resources on #1076, than on adding protected.)

Closing this issue, and deferring to the existing issue #835. Feel free to engage there.

@lrhn lrhn closed this as completed Aug 18, 2023
@lrhn lrhn added state-duplicate This issue or pull request already exists request Requests to resolve a particular developer problem labels Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Requests to resolve a particular developer problem state-duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants
@lrhn @offensive-penetrator and others