Closed
Description
Describe the issue
Linter allows comparing different enums, despite unrelated_type_equality_checks
enabled
To Reproduce
enum FilterGroupBy { date, competitions }
enum FilterMatchSelection { allMatches, onlyFavorites }
FilterGroupBy groupBy = FilterGroupBy.date;
FilterMatchSelection matchSelection = FilterMatchSelection.allMatches;
// No linter error
if (groupBy == FilterMatchSelection.onlyFavorites) {
}
// Comparing variables allowed either
if (groupBy == matchSelection) {
}
// Linter: Equality operator `==` invocation with references of unrelated types.
if (groupBy == 0) {
}
Expected behavior
Linter shows unrelated types error
Version
Dart SDK version: 2.16.0 (stable) (Mon Jan 31 15:28:59 2022 +0100) on "macos_x64"