13 lines
184 B
Kotlin
Vendored
13 lines
184 B
Kotlin
Vendored
fun <T, R> T.also(block: () -> R): R {
|
|
return null!!
|
|
}
|
|
|
|
fun foo(b: Boolean, a: Int) {
|
|
val x = when (b) {
|
|
true -> a
|
|
else -> null
|
|
}?.also {
|
|
1
|
|
}
|
|
}
|