dimsuz
05/06/2016, 10:23 AMfun hello() {
someActionOrFunWhichTriggersNull ?: return
statement1
statement2
}
To me that ?: return smells like using ? : to perform side-effects in java:
(i < 2) ? launchRockets() : goSafePath();
Which is not the right thing to do, cond ? this : that should be used as int value = cond ? this : that, in expressions.
I would expect that elivs-operator (?:) in Kotlin is an "expression" operator too: val v = getMaybeNull() ?: defaultValue.
Am I wrong?