Skip to content
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

Unable to link to named constructor if class has field of same name #2276

Closed
goderbauer opened this issue Jul 27, 2020 · 0 comments · Fixed by #2331
Closed

Unable to link to named constructor if class has field of same name #2276

goderbauer opened this issue Jul 27, 2020 · 0 comments · Fixed by #2331
Assignees
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@goderbauer
Copy link
Contributor

Example:

/// You can also use the [new Foo.bar] constructor.
class Foo {
  /// Creates with bar null.
  Foo() : bar = null;

  /// Creates with bar 1.
  Foo.bar() : bar = 1;

  /// The bar.
  final int bar;
}

The [new Foo.bar] links to the property and reports the following warning:

warning: ambiguous doc reference [new Foo.bar()] => 'dartdoc_test.Foo.bar', 'dartdoc_test.Foo.bar', from dartdoc_test.Foo: (file:///Users/goderbauer/dev/dartdoc_test/lib/dartdoc_test.dart:2:7)

I've tried some variations:

  • [new Foo.bar()] : links to property and shows the warning
  • [new Foo.bar] : links to property and shows the warning
  • [Foo.bar] : links to property, no warning (expected)
  • [Foo.bar()] : links to property and shows the warning
@srawlins srawlins added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P2 A bug or feature request we're likely to work on labels Jul 27, 2020
@srawlins srawlins self-assigned this Sep 3, 2020
auto-submit bot pushed a commit to flutter/flutter that referenced this issue Oct 12, 2023
Underlying bug (dart-lang/dartdoc#2276) has been fixed a while ago.
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 type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants