`if ((previous == null) or (previous.type == type)...
# announcements
m
if ((previous == null) or (previous.type == type)) {
IntelliJ complains about the dot here, why is
previous
not smart-cast to not null if it's checked first?
d
Depends where
previous
comes from.
m
It's a nullable argument to the function, so it's immutable
d
Oh, you're using
or
. You need to use
||
.
👆 1
or
does not short-circuit.
m
Oh right, thanks for pointing that out. 🙂
Now it works