test_types_in_equals false positive #35523
Labels
devexp-linter
Issues with the analyzer's support for the linter package
legacy-area-analyzer
Use area-devexp instead.
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
This code:
Led to this message from the analyzer:
...which is wrong. The type is checked, in the first line. The advice on the Web page (http://dart-lang.github.io/linter/lints/test_types_in_equals.html) is actually bad, because it does a check using "is" which doesn't guarantee equality, and leads to asymmetric equality, where
a == b
butb != a
ifa
is an instance of a superclass ofb
.The text was updated successfully, but these errors were encountered: