[linter] False positive prefer_const_constructors
incorrectly suggests adding const
#4978
Labels
P2
A bug or feature request we're likely to work on
set-flutter
Affects a rule in the recommended Flutter rule set
Given the following code, after Dart 3.4, the
prefer_const_constructors
lint is shown when invoking theInterval
constructor in such conditions:Running the Add 'const' modifier quick fix causes the code to violate
const_eval_extension_type_method
:A similar false positive—although I remember seeing this one on Dart 3.3 as well—can also be seen in a slightly different situation:
Where applying the quick fix leads to the same broken code:
See dart info
General info
Project info
The text was updated successfully, but these errors were encountered: