Extract Function: Traverse nested pseudocode instructions

#KT-5178 Fixed
This commit is contained in:
Alexey Sedunov
2014-06-20 17:29:54 +04:00
parent c7d8ab8219
commit 14362134bd
8 changed files with 104 additions and 41 deletions
@@ -0,0 +1,11 @@
// SIBLING:
fun main(args: Array<String>) {
<selection>val a = 1</selection>
val t = object: T {
override fun foo(n: Int) = n + a
}
}
trait T {
fun foo(n: Int): Int
}
@@ -0,0 +1 @@
Following variables are used outside of selected code fragment: a
@@ -0,0 +1,9 @@
// SIBLING:
fun main(args: Array<String>) {
<selection>val a = 1</selection>
lambda {
a
}
}
fun lambda(f: () -> Unit) {}
@@ -0,0 +1 @@
Following variables are used outside of selected code fragment: a
@@ -0,0 +1,5 @@
// SIBLING:
fun main(args: Array<String>) {
<selection>val a = 1</selection>
fun foo() = a
}
@@ -0,0 +1 @@
Following variables are used outside of selected code fragment: a