mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
9 lines
145 B
Kotlin
Vendored
9 lines
145 B
Kotlin
Vendored
// !LANGUAGE: +VariableDeclarationInWhenSubject
|
|
|
|
val x = 1
|
|
|
|
fun box() =
|
|
when (val y = x) {
|
|
1 -> "OK"
|
|
else -> "Fail: $y"
|
|
} |