Skip to content

Commit a69d93d

Browse files
scheglovCommit Queue
authored andcommitted
DeCo. Change to 'class EnumBody implements AstNode', not 'ClassBody'.
Paul and I discussed offline in the context of https://dart-review.googlesource.com/c/sdk/+/457161 and decided that `EnumBody` is different enough that it does not fit into the `ClassBody` hierarchy. For example `ClassDeclaration` has `body`, but it cannot have `EnumBody`. Bug: #61701 Change-Id: Icccbf87883cdfa42b0dd026a5ddc9a40d644a5ea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/458440 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
1 parent cfdd238 commit a69d93d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pkg/analyzer/api.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ package:analyzer/dart/ast/ast.dart:
871871
CatchClauseParameter (class extends AstNode):
872872
declaredFragment (getter: LocalVariableFragment?)
873873
name (getter: Token)
874-
ClassBody (class extends Object implements AstNode, sealed (immediate subtypes: BlockClassBody, ClassBodyImpl, EmptyClassBody, EnumBody), experimental)
874+
ClassBody (class extends Object implements AstNode, sealed (immediate subtypes: BlockClassBody, ClassBodyImpl, EmptyClassBody), experimental)
875875
ClassDeclaration (class extends Object implements NamedCompilationUnitMember):
876876
abstractKeyword (getter: Token?)
877877
augmentKeyword (getter: Token?)
@@ -1050,7 +1050,7 @@ package:analyzer/dart/ast/ast.dart:
10501050
semicolon (getter: Token)
10511051
EmptyStatement (class extends Object implements Statement):
10521052
semicolon (getter: Token)
1053-
EnumBody (class extends Object implements ClassBody, sealed (immediate subtypes: EnumBodyImpl), experimental):
1053+
EnumBody (class extends Object implements AstNode, sealed (immediate subtypes: EnumBodyImpl), experimental):
10541054
constants (getter: NodeList<EnumConstantDeclaration>)
10551055
leftBracket (getter: Token)
10561056
members (getter: NodeList<ClassMember>)

pkg/analyzer/lib/dart/ast/visitor.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
214214

215215
@experimental
216216
@override
217-
R? visitEnumBody(EnumBody node) => visitClassBody(node);
217+
R? visitEnumBody(EnumBody node) => visitNode(node);
218218

219219
@override
220220
R? visitEnumConstantArguments(EnumConstantArguments node) => visitNode(node);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7077,7 +7077,7 @@ final class EmptyStatementImpl extends StatementImpl implements EmptyStatement {
70777077
/// The enum declaration body, with constants and members.
70787078
@AnalyzerPublicApi(message: 'exported by lib/dart/ast/ast.dart')
70797079
@experimental
7080-
sealed class EnumBody implements ClassBody {
7080+
sealed class EnumBody implements AstNode {
70817081
/// The enumeration constants being declared.
70827082
NodeList<EnumConstantDeclaration> get constants;
70837083

@@ -7103,7 +7103,7 @@ sealed class EnumBody implements ClassBody {
71037103
GenerateNodeProperty('rightBracket'),
71047104
],
71057105
)
7106-
final class EnumBodyImpl extends ClassBodyImpl implements EnumBody {
7106+
final class EnumBodyImpl extends AstNodeImpl implements EnumBody {
71077107
@generated
71087108
@override
71097109
final Token leftBracket;

0 commit comments

Comments
 (0)