Sdk: analyzer/linter unrelated_type_equality_checks fails to recognize mixin constraints

Created on 2 Oct 2018  路  4Comments  路  Source: dart-lang/sdk

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

P1 area-analyzer type-bug

Most helpful comment

I'm looking into this now.

All 4 comments

I'm looking into this now.

I'm still seeing this on analyzer version 0.33.0 and linter version 0.1.68

nvm, was hitting a wrong version of the Dart SDK.

Was this page helpful?
0 / 5 - 0 ratings