state.text = when {
timesClicked == 1 -> "i did it!"
timesClicked in 2..9 -> "i did it again!"
timesClicked in 10..20 -> "i have nothing better to do!"
else -> "you can stop now."
}
This one,
Copy code
state.text = when (timesClicked) {
1 -> "i did it!"
in 2..9 -> "i did it again!"
in 10..20 -> "i have nothing better to do!"
else -> "you can stop now."
}
kills the compiler with
org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (66,17)