You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you suggesting that the ?. operator skip the entirety of the current statement if it attempts to dereference null? Otherwise those two snippets have different semantics.
This issue was originally filed by [email protected]
It would be nice if we could prevent null ref errors by adding Existential operator support.
e.g. Instead of
if(foo != null && foo.bar != null && foo.bar.baz != null) {
print (foo.bar.baz.monkey);
}
you have
print foo?.bar?.baz?.monkey
The text was updated successfully, but these errors were encountered: