Skip to content

analyzer 5.11.0 + dart_style 2.3.0 breaks build_runner build #52159

@point-source

Description

@point-source

I am using these dependencies to generate a library from a swagger file:

  • analyzer: 5.11.0
  • dart_style: 2.3.0
  • swagger_dart_code_generator: 2.10.4

When I try to build via flutter pub run build_runner build --delete-conflicting-outputs, I get the following error:

../../../../../.pub-cache/hosted/pub.dev/dart_style-2.3.0/lib/src/source_visitor.dart:2218:19: Error: The getter 'interfaceKeyword' isn't defined for the class 'MixinDeclaration'.
 - 'MixinDeclaration' is from 'package:analyzer/dart/ast/ast.dart' ('../../../../../.pub-cache/hosted/pub.dev/analyzer-5.11.0/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'interfaceKeyword'.
    modifier(node.interfaceKeyword);
                  ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/dart_style-2.3.0/lib/src/source_visitor.dart:2219:19: Error: The getter 'finalKeyword' isn't defined for the class 'MixinDeclaration'.
 - 'MixinDeclaration' is from 'package:analyzer/dart/ast/ast.dart' ('../../../../../.pub-cache/hosted/pub.dev/analyzer-5.11.0/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'finalKeyword'.
    modifier(node.finalKeyword);
                  ^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/dart_style-2.3.0/lib/src/source_visitor.dart:2220:19: Error: The getter 'sealedKeyword' isn't defined for the class 'MixinDeclaration'.
 - 'MixinDeclaration' is from 'package:analyzer/dart/ast/ast.dart' ('../../../../../.pub-cache/hosted/pub.dev/analyzer-5.11.0/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'sealedKeyword'.
    modifier(node.sealedKeyword);
  • Dart SDK version: 2.19.0 (stable) (Mon Jan 23 11:29:09 2023 -0800) on "macos_arm64"
  • OS: macOS 13.3.1 (22E261)

Downgrading analyzer to 5.10.0 resolves the issue.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions