With package:analyzer
version 0.33.0-alpha.0
and package:linter
version 0.1.66
the unrelated_type_equality_checks
is unable to recognize type compatibility correctly when the types bounds are specified using the on
clause:
abstract class A {
A parent;
}
class B extends A {
}
mixin M<T extends B> on B {
void foo(T t) {
assert(t.parent == this);
// ^
// Equality operator `==` invocation with references of unrelated types.
}
}
I’m looking into this now.