analyzer/linter unrelated_type_equality_checks fails to recognize mixin constraints

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.
  }
}

@pq @JekCharlsonYu @stereotype441 @bwilkerson

Author: Fantashit

1 thought on “analyzer/linter unrelated_type_equality_checks fails to recognize mixin constraints

Comments are closed.