-
Notifications
You must be signed in to change notification settings - Fork 125
Dartdoc does not narrow parameter types in descendants #1512
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
Comments
@alsemenov, thanks for filing the issue. |
The first example is working as (currently) intended. Dartdoc canonicalization eliminated the creation of duplicate entries for inherited members of classes. Instead, when clicking on the entry, you will get the original definition(*) for the member. This is indicated by the navigation change as well. For the second example, I don't see a distinction; both examples are inherited. From the perspective of the inheriting class, you see the parameterized types, but from the parent class, you do not. The current situation is a tradeoff, between making it easy to discern where a member is inherited from vs easy to determine what its type parameters are. So far, the bulk of feedback has been strongly biased toward the former. A possible way to resolve this tradeoff to solve both needs is to create pages for the inheriting class's context that somehow make it extra clear where the inherited object comes from while still displaying the inheriting class's type resolution. @alsemenov, if you think that would be helpful, I can mark this as a possible enhancement. It'll of course be prioritized based on feedback coming in. Thanks again for the report! (*) - from the perspective of the public interface of the package. Depending on reexports and private libraries, the code may actually have the original definition elsewhere. |
Regarding the first example, is it possible to parametrize the pages of base class, so pages of descendat classes could refer to it as Regarding the second example, I think it is a bug. The description:
is found on the dart:io:Socket page, which states that |
For the first example, that might be one way to solve the problem. The parameterization would also have to include sufficient navigation information to indicate that these type parameters are specific to the original context. Problems with dartdoc keeping track of this sort of thing lead to our second example: What you're talking about from the second example is another working as intended bit, even though it is confusing. In fact, recent changes to type handling have actually broken this in the head version of dartdoc, I'm going to file a separate bug. |
From @alsemenov on October 6, 2017 2:47
Lets consider class dart:io:Socket as an example. Its description reads:
Lets look at the methods and properties of the class Socket
On the front page:
Following the link:
Please, note that <List<int>> is now replaced by T, which is confusing.
The same situation is observed for property
last
.For methods situation is a bit different. On the front page:
Following the link:
Please, notice that parameter type T is replaced wih actual type sometimes.
Copied from original issue: dart-lang/sdk#31020
The text was updated successfully, but these errors were encountered: