[dart2js] Remove as checks where the expression is known to be null and the cast type is nullable.

Change-Id: I3f17a581d77bf4cfda90cf931c4bbdf0a53d0929
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286681
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This commit is contained in:
Nate Biggs 2023-03-09 22:08:46 +00:00 committed by Commit Queue
parent c19720245c
commit 624fc6a9d6

View file

@ -4344,6 +4344,8 @@ AbstractBool _typeTest(
if (expressionIsNull.isPotentiallyTrue) {
if (dartType.isObject) return AbstractBool.Maybe;
}
} else if (expressionIsNull.isDefinitelyTrue && _nullIs(dartType)) {
return AbstractBool.True;
}
if (checkedAbstractValue.isPrecise &&