KT-3189 Function invoke is called with no reason
prioritize tasks specially for invoke #KT-3189 Fixed #KT-3190 Fixed #KT-3297 Fixed
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
//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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user