DDC: Evaluation of e1 == e2
should detect null before any type checks
#41866
Labels
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
NNBD
Issues related to NNBD Release
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
web-dev-compiler
Consider the following program (which is a slice of
language/operator/equality_covariant_test.dart
, which is added by https://dart-review.googlesource.com/c/sdk/+/145582):This test fails on the configuration ddc-nnbd-linux-release-chrome-try (log), with the following stack trace:
However, evaluation of an expression of the form
e1 == e2
is specified to run in phases where null is processed first. In particular,oNever == myNull
should evaluateoNever
to an object different from null, and evaluatemyNull
to null, and then yield false, and up to this point there is no type check of any of these objects.The actual behavior is that it is checked whether null is of type
Never
, which is not the case in strong checking mode, and the evaluation then throws rather than yielding false.The text was updated successfully, but these errors were encountered: