also exhaustive when does not work as you would ex...
# codereview
u
also exhaustive when does not work as you would expect:
Copy code
// does not compile
fun eval(response: Response): String = when (response) {
    is FailedToPair -> "FailedToPair"
    is NewPairing -> "NewPairing"
    is ExistingPairing -> "ExistingPairing"
    is PairingForgotten -> "PairingForgotten"
    is CameraStatusResponse -> "CameraStatusResponse"
}

// does compile
fun eval(response: Response.PairingResponse) = when (response) {
    is FailedToPair -> "FailedToPair"
    is NewPairing -> "NewPairing"
    is ExistingPairing -> "ExistingPairing"
    is PairingForgotten -> "PairingForgotten"
}