-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add public and private access modifiers to language #1446
Comments
It's still not entirely clear what those modifiers should do. The linked thread has multiple designs, and all of them has some details left unspecified. Not being able to declare something as public or private could be a problem, but you can do that (everything is either public or "library private"). So, it would be a lack of some notion of privacy different from library privacy, typically "class privacy". The need for such a thing has not been established (you can declare one class per library, then library privacy is class privacy). Not liking the syntax of Writing If
So if code inside So, in short, it's either
This is a possible, consistent definition of a |
I'll add few more words, maybe it will be a compromise that everyone needs. Changes
Why so many modifiers?
Benefits
Drawbacks
Bottom LineNon-breaking compromise that doesn't offend anyone. |
One of the benefits of having a class Foo {
const Foo({required this.bar});
final private int bar;
} |
I think that with the current version of Dart which is 3.1 at the time of creating this post, it already covers much of what was requested regarding class access modifiers, this topic should be closed. |
Good morning, I open this issue to raise the idea in the correct place, all the details are in the following link: Add public and private access modifiers to language
The text was updated successfully, but these errors were encountered: