--
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/CAPiP%2BgsDE0RGpvhX27FVgo%2BtWPutinD5ERSjZ-a0x0shV%3Dxzwg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/CAO5M3uhRb7v%3DnnUvBY6SoB%2Bkg3rnHLLgRj%3Drn3CS1f4kpV8KqA%40mail.gmail.com.
Hi,I asked the question because in lib/dart/ast/ast.dart there are only 2 declaration of `get metadata;` (one in AnnotatedNode and one in FormalParameter) and there are only 2 declaration of `get documentationComment;` (one in AnnotatedNode and one in NormalFormalParameter). This looks like an exception that can be fixed by making FormalParameter a subtype of AnnotatedNode (that is only adding `get documentationComment;` on FormalParameter - not a big deal IMHO).In my particular case, if FormalParameter was a subtype of AnnotatedNode it would make my code easier because I would be able to rely on firstTokenAfterCommentAndMetadata and sortedCommentAndAnnotations directly from AnnotatedNode. Today I have to make a special case for FormalParameter by simulating those methods.Alexandre--Le sam. 12 juin 2021 à 00:33, 'Brian Wilkerson' via Dart Analyzer Discussion <analyzer...@dartlang.org> a écrit :`DefaultFormalParameter` doesn't have a `documentationComment` getter because the documentation comment (if there is one, which is presumably rare) is associated with the `NormalFormalParameter` that's a child of the `DefaultFormalParameter`. In general, we limit the API for each node to only include accessors for the direct children of the node. It might be more appropriate to ask why `FormalParameter` has a getter for the metadata when the metadata is also associated with the `NormalFormalParameter`. I don't have an answer for that one; I can only guess that it was an oversight that was never corrected.--On Fri, Jun 11, 2021 at 2:45 PM Alexandre Ardhuin <alexandr...@gmail.com> wrote:Hi,--I wondered why FormalParameter doesn't extend/implement AnnotatedNode. Looking at the ast tree of objects it seems that's because DefaultFormalParameter doesn't have a documentationComment getter but I don't really understand why. Is it intended?Alexandre
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/CAPiP%2BgsDE0RGpvhX27FVgo%2BtWPutinD5ERSjZ-a0x0shV%3Dxzwg%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/CAO5M3uhRb7v%3DnnUvBY6SoB%2Bkg3rnHLLgRj%3Drn3CS1f4kpV8KqA%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/CAPiP%2BgsYnxO0Zug%2Bh8KH9cmyD2O_5JSKqPQy20gZVoCwKVB3rw%40mail.gmail.com.