dart-lang / dart_style

An opinionated formatter/linter for Dart code
https://pub.dev/packages/dart_style
BSD 3-Clause "New" or "Revised" License
645 stars 118 forks source link

`analyzer-6.5.0` breaks `dart_style-2.3.2` #1452

Closed ditman closed 4 months ago

ditman commented 4 months ago

It seems that analyzer-6.5.0 has removed (?) ClassDeclaration.inlineKeyword, which breaks dart_style-2.3.2.

We found this error OOB on flutter/packages' post-submit checks, with an error similar to this:

Running command: "dart run tool/run_tests.dart" in C:\b\s\w\ir\x\w\packages\packages\go_router_builder
../../../.pub-cache/hosted/pub.dev/dart_style-2.3.2/lib/src/source_visitor.dart:593:19: Error: The getter 'inlineKeyword' isn't defined for the class 'ClassDeclaration'.
 - 'ClassDeclaration' is from 'package:analyzer/src/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.dev/analyzer-6.5.0/lib/src/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'inlineKeyword'.
    modifier(node.inlineKeyword);
                  ^^^^^^^^^^^^^

[packages/go_router_builder completed in 0m 18s]
ditman commented 4 months ago

I'm resolving an outdated version of dart_style, grr....

ditman commented 4 months ago

PEBCAK, my apologies! The broken package was pinning an old version of dart_style.