Kotlin, Android, Software Development, Kotlin Multiplatform, Java.
Error(val exception: Exception): ScreenState // IDE doesn't offer to prefill branches // compiler doesn't complain that we didn't check Loading and Error states when(screenState){ is Success -> TODO() } Sealed classes and interfaces allow us to define a restricted class hierarchy where all the