Changed paths:
M pkg/analyzer/lib/src/dart/ast/ast.dart
M pkg/analyzer/lib/src/lint/constants.dart
M pkg/linter/lib/src/rules/prefer_const_constructors_in_immutables.dart
M pkg/linter/test/rules/prefer_const_constructors_in_immutables_test.dart
Log Message:
-----------
linter: prefer_const_constructors_in_immutables support for Primary Constructors
* I made the `constKeyword` field non-final in order to support the
`canBeConst` utility.
* I refactored how the rule worked with extension types, since it
already sort of worked with those primary constructors.
* Unfortunately, PrimaryConstructorDeclaration and
ConstructorDeclaration are different enough that I mostly doubled the
implementation of both the `canBeConst` utility, and the visit
methods in the lint rule.
* I moved `hasImmutableAnnotation` to be an extension getter.
* I moved the error location to be the open parenthesis of an unnamed
primary constructor, which changes one existing test expectation, from
`E` to `(`. This is more correct, I believe.
M pkg/analyzer/lib/src/dart/scanner/scanner.dart
M pkg/analyzer/lib/src/dart/scanner/translate_error_token.dart
M pkg/analyzer/lib/src/diagnostic/diagnostic.g.dart
M pkg/analyzer/lib/src/fasta/error_converter.dart
M pkg/analyzer/messages.yaml
M pkg/front_end/test/scanner_cfe_test.dart
M pkg/front_end/test/scanner_replacement_test.dart
M pkg/front_end/test/scanner_test.dart
Log Message:
-----------
[messages] Use literate API for scanner error reporting.
Changes the error reporting logic in the `Scanner` class to use the
literate diagnostic reporting API, along with the top level function
`translateErrorToken`, which `Scanner` makes use of.
This required changing the signature of the `ReportError` typedef,
which is used to communicate scanner errors to front end unit tests.
M pkg/analyzer/lib/src/dart/analysis/driver.dart
M pkg/analyzer/lib/src/dart/element/element.dart
M pkg/analyzer/test/dart/sdk/build_sdk_summary_test.dart
Log Message:
-----------
Issue 62422. Work around not existing file in Flutter SDK.
I plan to release 'analyzer 10.0.1' with this change cherry-picked into
the branch with 'analyzer 10.0.0'.