-
Notifications
You must be signed in to change notification settings - Fork 119
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
"Hide" default constructor of abstract final
classes
#3733
Comments
Couple clarifying questions:
|
As some examples: abstract class C {
/// I wrote this comment for a reason.
C();
/// Comment
C.named();
// No comment.
C.anotherName();
} |
But a purely abstract class it makes sense to show the ctor because anyone can extend, right? |
Ah yes, the presense of the constructors is important, if you can extend it. 👍 |
abstract interface class Hide the default ctor for this as well? |
Another example here: https://api.dart.dev/main/705c745e19b1b354a2faa32913dbe3f22cc12969/dart-typed_data/TypedDataList-class.html Showing the (default) constructor here is just confusing. |
This should be easy, and I see the motivation. But @kevmoo I'd love to clarify a few examples:
I think (1) sounds fair. I'm not sure on (2). According to the modifier reference (I love this table), none of the following declarations can be constructed or directly extended (such that someone would want to know super parameters):
(Also So don't document generative constructors of the above 3 categories. WDYT @kevmoo ? |
My understanding, @srawlins - is that for We should double-check with someone on the language team, though. @leafpetersen @jakemac53 ? |
@kallentu also implemented the feature and has worked on dartdoc 😁 |
Don't have strong opinions. No one outside of the library can directly call the constructor, but they could end up indirectly calling it (and so could end up stepping through it, debugging it, etc). I guess dart doc is mostly there for seeing what you can call, so maybe a good argument for hiding it? |
If there are no parameters, it is almost certainly NOT useful for anyone looking at docs.
The text was updated successfully, but these errors were encountered: