MENU

Fun & Interesting

Guards in Kotlin 2.1

Kotlin by JetBrains 4,853 1 day ago
Video Not Working? Fix It Now

When expressions have always been powerful, but in Kotlin 2.1 it is becoming even more powerful with guards. Learn more in this video! To enable it: Ensure you are using Kotlin 2.1.0 or later in your project Add -Xwhen-guards as a compiler argument For IDE support: Use the latest 2024.3 version of IntelliJ IDEA with K2 mode enabled (requires restart)

Comment