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

Extension type instance variables in default constructors are marked as missing documentation #1393

Closed
albertms10 opened this issue Aug 7, 2024 · 3 comments
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@albertms10
Copy link

albertms10 commented Aug 7, 2024

Having extension type declarations as such:

/// Documented extension type.
extension type const Frequency._(num hertz) implements num { 
  // ...
}

leads to these warnings in the Provide documentation section from Pub.dev analysis (see music_notes score example):

Pub.dev Provide documentation Pana


After looking into the code, it seems instance variables in extension type default constructors—which ATM cannot be documented at all—are not excluded from the list of symbols missing documentation.

final symbolsMissingDocumentation = apiElements
// filter out names that have documentation
.whereNot((e) => symbolsWithDocumentation.contains(e.qualifiedName))
// Some symbols are present here without being in the code. E.g. an enum may
// omit the default constructor, and we would report it as undocumented here.
// Filtering out typically hidden constructors (e.g. `<A>.<A>`) if the parent
// type has a documentation.
.whereNot((e) =>
e.parent != null &&
e.parent!.split('.').last == e.name &&
symbolsWithDocumentation.contains(e.parent!))

@isoos isoos added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Aug 7, 2024
@isoos
Copy link
Collaborator

isoos commented Aug 7, 2024

Thanks for reporting this, we should add the exclusions!

@isoos
Copy link
Collaborator

isoos commented Aug 9, 2024

I'm unsure if this is something dartdoc could fix, so I've filed dart-lang/dartdoc#3830.

@sigurdm
Copy link
Contributor

sigurdm commented Aug 22, 2024

Closing in favor of dart-lang/dartdoc#3830

@sigurdm sigurdm closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants