mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 15:53:55 +00:00
19 lines
279 B
Kotlin
19 lines
279 B
Kotlin
// NEXT_SIBLING:
|
|
fun foo(a: Int): Int {
|
|
var b: Int = 1
|
|
|
|
<selection> when {
|
|
a > 0 -> {
|
|
b = b + 1
|
|
}
|
|
a < 0 -> {
|
|
b = b - 1
|
|
}
|
|
else -> {
|
|
b = a
|
|
}
|
|
}
|
|
println(b)</selection>
|
|
|
|
return b
|
|
} |