cf5c5dba3d
prioritize tasks specially for invoke #KT-3189 Fixed #KT-3190 Fixed #KT-3297 Fixed
17 lines
325 B
Kotlin
17 lines
325 B
Kotlin
//KT-3297 Calling the wrong function inside an extension method to the Function0 class
|
|
|
|
fun <R> Function0<R>.or(alt: () -> R): R {
|
|
try {
|
|
return this()
|
|
} catch (e: Exception) {
|
|
return alt()
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
return {
|
|
throw RuntimeException("fail")
|
|
} or {
|
|
"OK"
|
|
}
|
|
} |