Extract Function: Fix replacement of references with class receivers (objects, class objects, enum classes)

This commit is contained in:
Alexey Sedunov
2014-05-23 18:13:39 +04:00
parent 240f033f4f
commit 3d6fc6e015
8 changed files with 117 additions and 7 deletions
@@ -0,0 +1,14 @@
// SIBLING:
class MyClass {
fun test() {
<selection>P.A.foo()
P.A.a</selection>
}
enum class P {
A
val a = 1
fun foo() = 1
}
}
@@ -0,0 +1,18 @@
// SIBLING:
class MyClass {
fun test() {
unit()
}
enum class P {
A
val a = 1
fun foo() = 1
}
}
fun unit() {
MyClass.P.A.foo()
MyClass.P.A.a
}
@@ -0,0 +1,12 @@
// SIBLING:
class MyClass {
fun test() {
<selection>P.foo()
P.a</selection>
}
object P {
val a = 1
fun foo() = 1
}
}
@@ -0,0 +1,16 @@
// SIBLING:
class MyClass {
fun test() {
unit()
}
object P {
val a = 1
fun foo() = 1
}
}
fun unit() {
MyClass.P.foo()
MyClass.P.a
}
@@ -0,0 +1,12 @@
package p.q
val a = 1
fun foo() = 1
// SIBLING:
class MyClass {
fun test() {
<selection>p.q.foo()
p.q.a</selection>
}
}
@@ -0,0 +1,16 @@
package p.q
val a = 1
fun foo() = 1
// SIBLING:
class MyClass {
fun test() {
unit()
}
}
fun unit() {
foo()
a
}