Extract Function: Exclude unused parameters (jump-based control flow)

This commit is contained in:
Alexey Sedunov
2014-07-04 14:52:37 +04:00
parent fde7e52bf0
commit a6882f6670
4 changed files with 53 additions and 8 deletions
@@ -0,0 +1,7 @@
// PARAM_TYPES: kotlin.Int
// PARAM_DESCRIPTOR: value-parameter val a: kotlin.Int defined in foo
// SIBLING:
fun foo(a: Int, b: Int): Int {
<selection>if (a > 0) return a + b</selection>
return 0
}
@@ -0,0 +1,12 @@
// PARAM_TYPES: kotlin.Int
// PARAM_DESCRIPTOR: value-parameter val a: kotlin.Int defined in foo
// SIBLING:
fun foo(a: Int, b: Int): Int {
if (b(a)) return a + b
return 0
}
fun b(a: Int): Boolean {
if (a > 0) return true
return false
}