Open
Description
It would be nice to have a shorthand for this:
val == null ? null : method(val);
This is the opposite of val ?? method(val)
which only returns method(val) when val is null.
We love the null friendly operators so it bugs me a lot that I can't do this. Normally you would not need it if method can do ?. everywhere but sometimes the shorthand helps. For instance, some operators are not null friendly:
double convertFromMicro(Int64 value) =>
value == null ? null : value.toDouble() / _microDollars;
value?.toDouble() / _microDollars
would blow up if value is null.