"Make final" fix puts "final" in the wrong position in record destructuring #52820
Labels
analyzer-quick-fix
analyzer-server
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P3
A lower priority bug or feature request
I have the
prefer_final_locals
lint enabled which triggers on this code individually for bothkind
andvalue
:However the quick-fix inserts
final
before the variable name producing invalid code:I thought it should change
var
to final instead, although that affects more than just the variable where the fix was invoked. This led me to try the following:Here, the lint still fires for
kind
, but I don't know what I'd expect the fix to do here. Perhaps the lint should only fire if all declared variables can be changed to final? Or is there some way to destructure into a mix of final/non-final variables?The text was updated successfully, but these errors were encountered: