seems like smartcasting on `when` only works when ...
# announcements
n
seems like smartcasting on
when
only works when the selaed class type is casted to outside broken:

https://i.imgur.com/tUusyIE.png▾

working:
Copy code
val reducer: Reducer<MultiplayerState> = { state, action ->
    action as Actions
    when(action) {
        is Actions.AddObserver -> {
            state.copy(observers = state.observers + action.observer)
        }
        is Actions.RemoveObserver -> {
            state.copy(observers = state.observers - action.observer)
        }
        is Actions.SetConnectionState -> TODO()
    }.exhaustive
}