but this stone is reasonably soft, and with some effort we can reshape it later. Kotlin Design Team * The real sculpture made by José Manuel Castro López
• you need to explicitly opt in at the call site to use experimental features compileTestKotlin { kotlinOptions { freeCompilerArgs += "-Xinline-classes" } }
Compiler error: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String? We know something about isNullOrEmpty, which the compiler doesn’t
Compiler error: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String? We know something about isNullOrEmpty, which the compiler doesn’t if (s != null && s.isNotEmpty()) { s.first() } ✓
null) } return this == null || this.length == 0 } Contract: if the function returns false, the receiver is not-null val s: String? = "" if (!s.isNullOrEmpty()) { s.first() } ✓
{ callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return block() } Contract: block lambda will be always called once val answer: Int run { answer = 42 } ✓
just implicitly infer such information? Because then such implicitly inferred information: - can be implicitly changed - can accidentally break code depending on it
java.lang.Character.isUpperCase(this) Now: fun Char.isUpperCase(): Boolean = java.lang.Character.isUpperCase(this) Before: expect / actual in standard library
java.lang.Character.isUpperCase(this) Now: fun Char.isUpperCase(): Boolean = java.lang.Character.isUpperCase(this) Before: expect / actual in standard library
Kotlin Native to Port 6 years of Android Game Code to iOS in 6 months Shipping a Mobile Multiplatform Project on iOS & Android Your Multiplatform Kaptain has Arrived: iOS release is powered by Kotlin Multiplatform