is it possible to make when on enum properties?
# announcements
r
is it possible to make when on enum properties?
k
Copy code
when(enumValue.property) {
    ....
}
works fine.
r
Copy code
enum class Direction {
    NORTH, SOUTH, WEST, EAST
}

val d = Direction.WEST

when(d) {
   ....
}
how to do in this case?
k
Copy code
when(d) {
    NORTH, SOUTH -> "pole"
    else -> "not pole"
}
Just like a normal
when
.
r
thanks