test_types_in_equals false positive with runtimeType #57891
Labels
area-devexp
For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
devexp-linter
Issues with the analyzer's support for the linter package
linter-false-positive
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
From @Hixie on December 30, 2018 19:30
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
.Copied from original issue: #35523
The text was updated successfully, but these errors were encountered: