Skip to content

Dartdoc does not narrow parameter types in descendants #1512

Open
@anders-sandholm

Description

@anders-sandholm

From @alsemenov on October 6, 2017 2:47

Lets consider class dart:io:Socket as an example. Its description reads:

abstract class Socket
Implements Stream<List<int>>, IOSink

Lets look at the methods and properties of the class Socket
On the front page:

first → Future<List<int>>
Returns the first element of the stream.
read-only, inherited

Following the link:

Future<T> first
Returns the first element of the stream.

Stops listening to the stream after the first element has been received.

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:

distinct([bool equals(T previous, T next) ]) → Stream<List<int>>
Skips data events if they are equal to the previous data event.
inherited

Following the link:

Stream<T> distinct([bool equals(T previous, T next ) ])
Skips data events if they are equal to the previous data event.

Please, notice that parameter type T is replaced wih actual type sometimes.

pipe(StreamConsumer<List<int>> streamConsumer) → Future
Pipe the events of this stream into streamConsumer.
inherited

Copied from original issue: dart-lang/sdk#31020

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requesttype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions