Kotlin Contracts
The Kotlin type system is fairly flexible but there are a few corner cases where the compiler enforces rules which can be a little restrictive. For example, we can’t declare a val
then initialise it within a lambda as the compiler does not know how the lambda will be executed and therefore cannot…