I’ve got this code ```fun onFinishedProcessingEven...
# android
u
I’ve got this code
Copy code
fun onFinishedProcessingEvent(event: FinishedProcessing) {
    when (event) {
        is FinishedProcessingSuccessfully -> {
            onAuthenticationSuccess()
        }
        is FinishedProcessingUnsuccessfully -> {
            onAuthenticationFailure(event)
        }
    }
}
where
FinishedProcessing
is defined as follows
Copy code
sealed class FinishedProcessing(val status: String)
class FinishedProcessingSuccessfully(status: String = "success"): FinishedProcessing(status)
class FinishedProcessingUnsuccessfully(error: String) : FinishedProcessing(error)
Intellisense in Android Studio (Android Studio Arctic Fox | 2020.3.1 Patch 3) is suggesting that I make the when exhaustive by adding an
else
branch because I’m using a sealed class. However, as far as I can tell, this should be exhaustive without the else, or is there something I’m missing?
Ah, I found the issue, though it could potentially be a bug in intellisesne, my issue was the file the
FinishedProcessing
was in had the incorrect package directive.