uhe
06/23/2016, 2:28 PM// 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"
}