Skip to content

public_member_api_docs ignores constructors in abstract interface classes #59488

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

Open
Pante opened this issue Jul 30, 2024 · 2 comments
Open
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-false-negative 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

@Pante
Copy link

Pante commented Jul 30, 2024

Describe the issue
public_member_api_docs does not flag constructors in abstract interface classes that are undocumented.

To Reproduce

abstract interface class Foo {
  factory Foo.a() = Bar;
  
  factory Foo.b() => Bar();

  Foo();
}

class Bar extends Foo {}

Expected behavior
The constructors should be flagged as undocumented, similar to how they are flagged in abstract & interface classes.

@bwilkerson bwilkerson added P2 A bug or feature request we're likely to work on linter-false-negative labels Jul 30, 2024
@pq
Copy link
Member

pq commented Jul 30, 2024

This is related to #59210 but maybe we over-stepped in treating abstract interface classes as "effectively" private?

/cc @lrhn

@lrhn
Copy link
Member

lrhn commented Jul 30, 2024

I think the #59210 discussion was correct in saying that generative constructors of abstract non-extensible classes can be treated as private, because they have no valid public uses.
That doesn't extend to factory constructors, which can be called and torn off just like any static method.
(Yet another difference between factory and generative constructors which make it breaking to change one to the other.)

@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Sep 13, 2024
@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 20, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 20, 2024
@bwilkerson bwilkerson added area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. and removed legacy-area-analyzer Use area-devexp instead. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-false-negative 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

No branches or pull requests

6 participants