To loop back on this: I don't think any behavior has changed in dart2js or the VM, but Alexandre added new checks as of Dart ~2.0.0-dev.32.0. Thanks Alexandre!
- NULL_AWARE_BEFORE_OPERATOR: "The left operand uses '?.', so its value can be null."
For example, in `foo?.length + 1` - NULL_AWARE_IN_LOGICAL_OPERATOR: "The value of the '?.' operator can be 'null', which isn't appropriate as an operand of a logical operator."
For example in `foo?.isNotEmpty && bar?.isNotEmpty` or `!foo?.isNotEmpty`
When fixing up code that now features this new Hint, I found a lot of `a && b?.c ?? false`. Does this do what you think? Maybe not! It's actually `(a && b?.c) ?? false`. Boo. Luckily both the new analyzer hints catch this, and dartfmt can highlight this when it is forced to wrap lines. For example, dartfmt will output the following:
void main() {
var result1 =
something.attribute.otherAttribute && somethingOtherThing?.attr?.attr ??
false;
var result2 = something.attribute.otherAttribute &&
(somethingOtherThing?.attr?.attr ?? false);
}
Notice how dartfmt grouped `a && b` onto one line, breaking after `??`. A small hint. When you change the expressions with parens, for result2, dartfmt will now keep the `a ?? false` on one line, as that is one expression.