False prefer_const_constructors_in_immutables
on class that can never be const constructed
#58718
Labels
devexp-linter
Issues with the analyzer's support for the linter package
legacy-area-analyzer
Use area-devexp instead.
linter-false-positive
linter-set-flutter
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
The following code produces a misleading
prefer_const_constructors_in_immutables
lint:My understanding from flutter/flutter#102460 (comment) and dart-lang/language#1296 is that this class can never be const-constructed. So, suggesting to give it a const constructor is ... not helpful. :)
Instead, there should actually be the opposite warning: If you do make this constructor const, it should warn that this class can actually never be const constructed and that the const should be removed. I filed #58719 for that.
The text was updated successfully, but these errors were encountered: