Files
kotlin-fork/compiler/testData/codegen/box/functions/invoke/kt3297.kt
T
Svetlana Isakova cf5c5dba3d KT-3189 Function invoke is called with no reason
prioritize tasks specially for invoke

 #KT-3189 Fixed
 #KT-3190 Fixed
 #KT-3297 Fixed
2013-07-05 18:03:51 +04:00

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"
}
}