Current version: What’s new in Kotlin 1.3

Kotlin 1.3’s contracts are an experimental addition meant to enrich the type information available through the function system with additional meanings useful at the call site. A contract lets a function tell the compiler things such as “I affect smart casts this way” or “I execute this lambda exactly once.” The Kotlin standard library already has contracts added to several functions, which work regardless of experimental flags.