Extract Function: Merge jumps with default exits if all exit points are equivalent
#KT-6598 Fixed
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_DESCRIPTOR: value-parameter val a: kotlin.Int defined in foo
|
||||
// PARAM_DESCRIPTOR: val b: kotlin.Int defined in foo
|
||||
// SIBLING:
|
||||
fun foo(a: Int) {
|
||||
val b: Int = 1
|
||||
for (n in 1..b) {
|
||||
if (b(a, b)) break
|
||||
}
|
||||
}
|
||||
|
||||
private fun b(a: Int, b: Int): Boolean {
|
||||
if (a > 0) throw Exception("")
|
||||
if (a + b > 0) return true
|
||||
println(a - b)
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user