mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
9 lines
155 B
Kotlin
Vendored
9 lines
155 B
Kotlin
Vendored
// !LANGUAGE: +VariableDeclarationInWhenSubject
|
|
|
|
val x: Any = 1
|
|
|
|
fun box() =
|
|
when (val y = x) {
|
|
is Int -> "OK"
|
|
else -> "Fail: $y"
|
|
} |