Extract Function: Support implicit abnormal exits via Nothing-typed expressions

This commit is contained in:
Alexey Sedunov
2016-10-05 14:17:29 +03:00
parent 8e9f32db9e
commit d3c14ce7d6
8 changed files with 37 additions and 3 deletions
@@ -0,0 +1,11 @@
// WITH_RUNTIME
// PARAM_DESCRIPTOR: value-parameter a: kotlin.Int? defined in foo
// PARAM_TYPES: kotlin.Int?
fun foo(a: Int?): Int {
return i(a)
}
private fun i(a: Int?): Int {
val n = a ?: error("")
return n + 1
}