fun testFunction(number: Int) { val myShortCutCondition = true when(number){ 1 -> { if(myShortCutCondition){ print("jump out of execution") return@testFunction } print("continue with execution") // longCode "1" } 2 -> "2" else -> "" } } fun main() { testFunction(1) }