Skip to content

"Extends" for generic types isn't shown. #1027

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

Closed
floitschG opened this issue Nov 12, 2015 · 8 comments
Closed

"Extends" for generic types isn't shown. #1027

floitschG opened this issue Nov 12, 2015 · 8 comments
Labels
customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@floitschG
Copy link

floitschG commented Nov 12, 2015

Take https://api.dartlang.org/stable/dart-collection/LinkedList-class.html
The generic type E must extend LinkedListEntry. However that is not shown in the documentation.
In fact the LinkedList-signature is:
class LinkedList<E extends LinkedListEntry<E>> ...

@sethladd sethladd added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Nov 12, 2015
@sethladd
Copy link
Contributor

Thanks for the report!

@keertip keertip self-assigned this Nov 19, 2015
@keertip
Copy link
Collaborator

keertip commented Dec 9, 2015

@floitschG , the info about the generics is shown in the title.
screen shot 2015-12-09 at 11 19 21 am

@floitschG
Copy link
Author

Might be that the output changed, but it's not really great yet.

When I look for a constructor, I don't see the title anymore (I tried with my neighbor and he only found the generic type when I pointed out that the class is generic).
Also, the inheritance chain says that Object > Iterable<E> > LinkedList giving the impression that LinkedList isn't generic.
Finally, the title doesn't allow to click on the "LinkedListEntry". In fact the only place where "LinkedListEntry" is clickable is in the user-supplied dartdoc.

@keertip
Copy link
Collaborator

keertip commented Dec 9, 2015

Would adding this information to the inheritance chain be sufficient?

@floitschG
Copy link
Author

Probably sufficient, but you really want to see it with the constructors too. That's when you have to provide the generic type.
At the moment, the constructor doesn't show at all that there is a "hidden" additional argument.

@Hixie Hixie added customer-flutter Issues originating from important to Flutter P2 A bug or feature request we're likely to work on labels Jun 16, 2016
@keertip keertip removed their assignment Jul 20, 2016
@keertip keertip added this to the hackathon milestone Jul 21, 2016
@devoncarew devoncarew modified the milestone: hackathon Nov 22, 2016
@Hixie Hixie added P1 A high priority bug; for example, a single project is unusable or has many test failures and removed P2 A bug or feature request we're likely to work on labels Feb 13, 2017
@sethladd sethladd added P0 A serious issue requiring immediate resolution and removed P1 A high priority bug; for example, a single project is unusable or has many test failures labels Mar 30, 2017
@sethladd
Copy link
Contributor

Apologies, I'm not fully understanding what the recommended fix is here.

I see that part of the solution is to change Object > Iterable<E> > LinkedList to Object > Iterable<E> > LinkedList<E extends LinkedListEntry>

@sethladd sethladd added P1 A high priority bug; for example, a single project is unusable or has many test failures and removed P0 A serious issue requiring immediate resolution labels Mar 30, 2017
@floitschG
Copy link
Author

Yes. that would be a good start.

As a second step, we should improve the documentation for constructors:.
For example, https://api.dartlang.org/stable/1.22.1/dart-collection/LinkedList/LinkedList.html
There is no way to know that this constructor is on a class that takes a generic argument. We have 5 mentions of "LinkedList", but none shows "LinkedList<E extends ...>

@jcollins-g
Copy link
Contributor

Some screenshots for a proposed solution are in PR #1556.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

6 participants