undermark5
10/28/2021, 8:41 PMfun onFinishedProcessingEvent(event: FinishedProcessing) {
when (event) {
is FinishedProcessingSuccessfully -> {
onAuthenticationSuccess()
}
is FinishedProcessingUnsuccessfully -> {
onAuthenticationFailure(event)
}
}
}
where FinishedProcessing
is defined as follows
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?undermark5
10/28/2021, 9:04 PMFinishedProcessing
was in had the incorrect package directive.