Analyzer should spot misnamed constructors #19952
Labels
analyzer-warning
Issues with the analyzer's Warning codes
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by olivier.chafik@gmail.com
When doing manual refactorings of class name, I often forget to rename the constructor, which yields hard-to-detect bugs:
import 'package:di/di.dart';
class ModuleWithNewName extends Module {
ModuleWithOldName() {
bind(MyClass); // No, you will never be bound.
}
}
I think the analyzer should issue an info (if not a warning) when a capitalized method has no return type, to prevent these cases.
The text was updated successfully, but these errors were encountered: