prefer_final_locals incompatible with record destructuring in for loops #59120
Labels
devexp-linter
Issues with the analyzer's support for the linter package
legacy-area-analyzer
Use area-devexp instead.
Describe the issue
prefer_final_locals fails when destructuring a record in a for loop. See below for a simple example
To Reproduce
Dart code in
records.dart
:run with
dart --enable-experiment=records records.dart
Output:
In
analysis_options.yaml
:then analysis fails:
Expected behavior
prefer_final_locals
should recognize that the destructured locals are final.Additional context
None
The text was updated successfully, but these errors were encountered: