Skip to content

Commit 97a23cf

Browse files
scheglovCommit Queue
authored andcommitted
Issue 61231. Document that Declaration.declaredFragment is null for FieldDeclaration and TopLevelVariableDeclaration.
Bug: #61231 Change-Id: I50b175d8a8bc435947b4336f849960fe2f377846 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443680 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 75eeaa7 commit 97a23cf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/analyzer/lib/src/dart/ast/ast.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5620,6 +5620,11 @@ abstract final class Declaration implements AnnotatedNode {
56205620
/// The fragment declared by this declaration.
56215621
///
56225622
/// Returns `null` if the AST structure hasn't been resolved.
5623+
///
5624+
/// Returns `null` for [FieldDeclaration] and [TopLevelVariableDeclaration]
5625+
/// because these nodes don't declare any fragments, but individual
5626+
/// [VariableDeclaration]s inside them do. They are [Declaration]s mostly to
5627+
/// fit into [ClassDeclaration.members] and [CompilationUnit.declarations].
56235628
@experimental
56245629
Fragment? get declaredFragment;
56255630
}

0 commit comments

Comments
 (0)