![]() If you use when as an expression the compiler even forces you to handle the error case. Sealed class UserProfileResult Ĭontrary to exceptions (which are always unchecked in Kotlin), the compiler guides you to handle the error cases. Consequently, we can create pure functions (functions without side-effects) more easily. These features allow writing functional code in a safe, concise and expressive way. We can combine these control structures with other expressions concisely.
0 Comments
Leave a Reply. |