[analyzer] Soundness issue with typing of equality expressions #54083
Labels
area-dart-model
For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.
dart-model-analyzer-spec
Issues with the analyzer's implementation of the language spec
P3
A lower priority bug or feature request
soundness
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Consider the following example, based on this comment:
This shows that it is unsound to assume that the type of an
<equalityExpression>
isNever
, even in the case where the corresponding declaration ofoperator ==
has return typeNever
. Equality expressions should always have the typebool
.However, the analyzer (DartPad based on Dart SDK 3.3.0-16.0.dev) does not report any errors on the line marked 'Unsound', which implies that it considers
neverEqual == other
to be an expression that cannot complete normally.The text was updated successfully, but these errors were encountered: