Karlo Lozovina
09/17/2020, 10:21 PMwhen condition without binding it to a name? some sort of default provided name? For example in the code below, is it possible to write it without the temp variable?:
val temp = foo.bar.getBaz()
when (temp) {
is A -> print(temp)
is B -> ...
}Shawn
09/17/2020, 10:21 PMwhen (val temp = foo.bar.getBaz()) {
is A -> print(temp)
is B -> ...
}Shawn
09/17/2020, 10:22 PMKarlo Lozovina
09/17/2020, 10:22 PM