@@ -2684,8 +2684,7 @@ class ChildEntity {
26842684/// classModifiers ::= 'sealed'
26852685/// | 'abstract'? ('base' | 'interface' | 'final')?
26862686/// | 'abstract'? 'base'? 'mixin'
2687- abstract final class ClassDeclaration
2688- implements NamedCompilationUnitMember, FragmentDeclaration {
2687+ abstract final class ClassDeclaration implements NamedCompilationUnitMember {
26892688 /// The `abstract` keyword, or `null` if the keyword was absent.
26902689 Token? get abstractKeyword;
26912690
@@ -2921,7 +2920,7 @@ sealed class ClassMemberImpl extends DeclarationImpl implements ClassMember {
29212920///
29222921/// mixinApplication ::=
29232922/// [NamedType] [WithClause] [ImplementsClause]? ';'
2924- abstract final class ClassTypeAlias implements TypeAlias, FragmentDeclaration {
2923+ abstract final class ClassTypeAlias implements TypeAlias {
29252924 /// The token for the `abstract` keyword, or `null` if this isn't defining an
29262925 /// abstract class.
29272926 Token? get abstractKeyword;
@@ -4062,8 +4061,7 @@ final class ConstantPatternImpl extends DartPatternImpl
40624061///
40634062/// initializerList ::=
40644063/// ':' [ConstructorInitializer] (',' [ConstructorInitializer])*
4065- abstract final class ConstructorDeclaration
4066- implements ClassMember, FragmentDeclaration {
4064+ abstract final class ConstructorDeclaration implements ClassMember {
40674065 /// The `augment` keyword, or `null` if the keyword was absent.
40684066 Token? get augmentKeyword;
40694067
@@ -4797,6 +4795,12 @@ abstract final class Declaration implements AnnotatedNode {
47974795 /// node corresponds to a list of declarations or if the AST structure hasn't
47984796 /// been resolved.
47994797 Element? get declaredElement;
4798+
4799+ /// The fragment declared by this declaration.
4800+ ///
4801+ /// Returns `null` if the AST structure hasn't been resolved.
4802+ @experimental
4803+ Fragment? get declaredFragment;
48004804}
48014805
48024806sealed class DeclarationImpl extends AnnotatedNodeImpl implements Declaration {
@@ -4859,6 +4863,9 @@ final class DeclaredIdentifierImpl extends DeclarationImpl
48594863 @override
48604864 LocalVariableElementImpl? declaredElement;
48614865
4866+ @override
4867+ LocalVariableElementImpl? declaredFragment;
4868+
48624869 /// Initializes a newly created formal parameter.
48634870 ///
48644871 /// Either or both of the [comment] and [metadata] can be `null` if the
@@ -5539,7 +5546,7 @@ final class EnumConstantArgumentsImpl extends AstNodeImpl
55395546}
55405547
55415548/// The declaration of an enum constant.
5542- abstract final class EnumConstantDeclaration implements FragmentDeclaration {
5549+ abstract final class EnumConstantDeclaration implements Declaration {
55435550 /// The explicit arguments (there are always implicit `index` and `name`
55445551 /// leading arguments) to the invoked constructor, or `null` if this constant
55455552 /// doesn't provide any explicit arguments.
@@ -5641,8 +5648,7 @@ final class EnumConstantDeclarationImpl extends DeclarationImpl
56415648/// metadata 'enum' name [TypeParameterList]?
56425649/// [WithClause]? [ImplementsClause]? '{' [SimpleIdentifier]
56435650/// (',' [SimpleIdentifier])* (';' [ClassMember]+)? '}'
5644- abstract final class EnumDeclaration
5645- implements NamedCompilationUnitMember, FragmentDeclaration {
5651+ abstract final class EnumDeclaration implements NamedCompilationUnitMember {
56465652 /// The `augment` keyword, or `null` if the keyword was absent.
56475653 @experimental
56485654 Token? get augmentKeyword;
@@ -6364,8 +6370,7 @@ final class ExtendsClauseImpl extends AstNodeImpl implements ExtendsClause {
63646370/// 'extension' [SimpleIdentifier]? [TypeParameterList]?
63656371/// 'on' [TypeAnnotation] [ShowClause]? [HideClause]?
63666372/// '{' [ClassMember]* '}'
6367- abstract final class ExtensionDeclaration
6368- implements CompilationUnitMember, FragmentDeclaration {
6373+ abstract final class ExtensionDeclaration implements CompilationUnitMember {
63696374 /// The `augment` keyword, or `null` if the keyword was absent.
63706375 @experimental
63716376 Token? get augmentKeyword;
@@ -6694,7 +6699,7 @@ final class ExtensionOverrideImpl extends ExpressionImpl
66946699/// '}'
66956700@experimental
66966701abstract final class ExtensionTypeDeclaration
6697- implements NamedCompilationUnitMember, FragmentDeclaration {
6702+ implements NamedCompilationUnitMember {
66986703 /// The `augment` keyword, or `null` if the keyword was absent.
66996704 @experimental
67006705 Token? get augmentKeyword;
@@ -6923,6 +6928,9 @@ final class FieldDeclarationImpl extends ClassMemberImpl
69236928 @override
69246929 Element? get declaredElement => null;
69256930
6931+ @override
6932+ Fragment? get declaredFragment => null;
6933+
69266934 @override
69276935 Token get endToken => semicolon;
69286936
@@ -8073,18 +8081,6 @@ final class ForStatementImpl extends StatementImpl
80738081 }
80748082}
80758083
8076- /// A declaration of a fragment of an element.
8077- @experimental
8078- abstract final class FragmentDeclaration implements Declaration {
8079- // TODO(pq): move `declaredFragment` into `Declaration` and remove this class.
8080-
8081- /// The fragment declared by this declaration.
8082- ///
8083- /// Returns `null` if the AST structure hasn't been resolved.
8084- @experimental
8085- Fragment? get declaredFragment;
8086- }
8087-
80888084/// A node representing the body of a function or method.
80898085///
80908086/// functionBody ::=
@@ -8203,8 +8199,7 @@ sealed class FunctionBodyImpl extends AstNodeImpl implements FunctionBody {
82038199// augmented and declarations that can't be augmented. This results in getters
82048200// that are only sometimes applicable. Consider changing the class hierarchy so
82058201// that these two kinds of variables can be distinguished.
8206- abstract final class FunctionDeclaration
8207- implements NamedCompilationUnitMember, FragmentDeclaration {
8202+ abstract final class FunctionDeclaration implements NamedCompilationUnitMember {
82088203 /// The `augment` keyword, or `null` if there is no `augment` keyword.
82098204 @experimental
82108205 Token? get augmentKeyword;
@@ -8742,8 +8737,7 @@ final class FunctionReferenceImpl extends CommentReferableExpressionImpl
87428737///
87438738/// functionPrefix ::=
87448739/// [TypeAnnotation]? [SimpleIdentifier]
8745- abstract final class FunctionTypeAlias
8746- implements TypeAlias, FragmentDeclaration {
8740+ abstract final class FunctionTypeAlias implements TypeAlias {
87478741 @override
87488742 TypeAliasElement? get declaredElement;
87498743
@@ -9104,8 +9098,7 @@ final class GenericFunctionTypeImpl extends TypeAnnotationImpl
91049098/// functionTypeAlias ::=
91059099/// 'typedef' [SimpleIdentifier] [TypeParameterList]? =
91069100/// [FunctionType] ';'
9107- abstract final class GenericTypeAlias
9108- implements TypeAlias, FragmentDeclaration {
9101+ abstract final class GenericTypeAlias implements TypeAlias {
91099102 /// The equal sign separating the name being defined from the function type.
91109103 Token get equals;
91119104
@@ -11798,8 +11791,7 @@ final class MapPatternImpl extends DartPatternImpl implements MapPattern {
1179811791/// Prior to the 'extension-methods' experiment, these nodes were always
1179911792/// children of a class declaration. When the experiment is enabled, these nodes
1180011793/// can also be children of an extension declaration.
11801- abstract final class MethodDeclaration
11802- implements ClassMember, FragmentDeclaration {
11794+ abstract final class MethodDeclaration implements ClassMember {
1180311795 /// The token for the `augment` keyword.
1180411796 Token? get augmentKeyword;
1180511797
@@ -12195,8 +12187,7 @@ abstract final class MethodReferenceExpression implements Expression {
1219512187/// mixinDeclaration ::=
1219612188/// 'base'? 'mixin' name [TypeParameterList]?
1219712189/// [OnClause]? [ImplementsClause]? '{' [ClassMember]* '}'
12198- abstract final class MixinDeclaration
12199- implements NamedCompilationUnitMember, FragmentDeclaration {
12190+ abstract final class MixinDeclaration implements NamedCompilationUnitMember {
1220012191 /// The `augment` keyword, or `null` if the keyword was absent.
1220112192 Token? get augmentKeyword;
1220212193
@@ -17652,6 +17643,9 @@ final class TopLevelVariableDeclarationImpl extends CompilationUnitMemberImpl
1765217643 @override
1765317644 Element? get declaredElement => null;
1765417645
17646+ @override
17647+ Fragment? get declaredFragment => null;
17648+
1765517649 @override
1765617650 Token get endToken => semicolon;
1765717651
@@ -18052,7 +18046,7 @@ final class TypeLiteralImpl extends CommentReferableExpressionImpl
1805218046///
1805318047/// typeParameter ::=
1805418048/// name ('extends' [TypeAnnotation])?
18055- abstract final class TypeParameter implements Declaration, FragmentDeclaration {
18049+ abstract final class TypeParameter implements Declaration {
1805618050 /// The upper bound for legal arguments, or `null` if there's no explicit
1805718051 /// upper bound.
1805818052 TypeAnnotation? get bound;
@@ -18302,8 +18296,7 @@ class UriValidationCode {
1830218296// augmented and declarations that can't be augmented. This results in getters
1830318297// that are only sometimes applicable. Consider changing the class hierarchy so
1830418298// that these two kinds of variables can be distinguished.
18305- abstract final class VariableDeclaration
18306- implements Declaration, FragmentDeclaration {
18299+ abstract final class VariableDeclaration implements Declaration {
1830718300 /// The element declared by this declaration.
1830818301 ///
1830918302 /// Returns `null` if the AST structure hasn't been resolved or if this node
0 commit comments