Skip to content

dartdoc shows the wrong parameters for new-style generic function types #1472

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
jcollins-g opened this issue Jul 12, 2017 · 2 comments
Closed
Labels
P2 A bug or feature request we're likely to work on

Comments

@jcollins-g
Copy link
Contributor

A function that looks like this:

/// A typedef with the new style generic function syntax.
typedef NewGenericTypedef<T> = List<S> Function<S>(T, int, bool);

is currently documented as having parameters (T, T, T).

This is caused by analyzer producing ParameterElementImpls that compare equally to each other, subverting dartdoc's internal object cache. dart-lang/sdk#30146

@jcollins-g jcollins-g added the P2 A bug or feature request we're likely to work on label Jul 12, 2017
@jcollins-g
Copy link
Contributor Author

jcollins-g commented Sep 21, 2017

This also occurs for types created as functions with parameters defined outside of typedefs, for example:

  void Function(T1, T2) bindBinaryCallbackGuarded<T1, T2>(
      void callback(T1 argument1, T2 argument2));

will be documented as:

void Function(T1, T1) bindBinaryCallbackGuarded....

@jcollins-g
Copy link
Contributor Author

jcollins-g commented Dec 1, 2017

Fixed in #1524, though through a hacky workaround (disabling Dartdoc's object cache for parameters).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

1 participant