Move: Fix detection of imported declarations and processing of extension usages

#KT-5787 Fixed
 #KT-4959 Fixed
This commit is contained in:
Alexey Sedunov
2014-09-17 20:45:06 +04:00
parent b14e979d70
commit 735fd6c626
26 changed files with 366 additions and 110 deletions
@@ -0,0 +1,7 @@
package library
open public class B {
fun foo(): B = this
}
fun B.bar(): B = this
@@ -0,0 +1,5 @@
package source
import target.A
fun test1() = target.test(A())
@@ -0,0 +1,21 @@
package target
import library.B
import library.bar
public class A: B() {
fun test() {
bar()
foo()
this.bar()
this.foo()
}
}
public fun test(a: A) {
a.bar()
a.foo()
B().foo().bar()
B().foo().bar()
B().bar().foo()
}
@@ -0,0 +1,3 @@
package target
fun test2() = test(A())
@@ -0,0 +1,7 @@
package library
open public class B {
fun foo(): B = this
}
fun B.bar(): B = this
@@ -0,0 +1,21 @@
package source
import library.B
import library.bar
public class A: B() {
fun test() {
bar()
foo()
this.bar()
this.foo()
}
}
public fun test(a: A) {
a.bar()
a.foo()
B().foo().bar()
library.B().foo().bar()
B().bar().foo()
}
@@ -0,0 +1,3 @@
package source
fun test1() = test(A())
@@ -0,0 +1,3 @@
package target
fun test2() = source.test(source.A())
@@ -0,0 +1,5 @@
{
"mainFile": "source/A.kt",
"type": "MOVE_FILES",
"targetPackage": "target"
}
@@ -0,0 +1,7 @@
package library
open public class B {
fun foo(): B = this
}
fun B.bar(): B = this
@@ -0,0 +1,5 @@
package source
import target.A
fun test1() = A()
@@ -0,0 +1,16 @@
package target
import library.bar
import library.B
public class A: B() {
fun test() {
bar()
foo()
this.bar()
this.foo()
B().foo().bar()
B().foo().bar()
B().bar().foo()
}
}
@@ -0,0 +1,3 @@
package target
fun test2() = A()
@@ -0,0 +1,7 @@
package library
open public class B {
fun foo(): B = this
}
fun B.bar(): B = this
@@ -0,0 +1,16 @@
package source
import library.B
import library.bar
public class <caret>A: B() {
fun test() {
bar()
foo()
this.bar()
this.foo()
B().foo().bar()
library.B().foo().bar()
B().bar().foo()
}
}
@@ -0,0 +1,3 @@
package source
fun test1() = A()
@@ -0,0 +1,3 @@
package target
fun test2() = source.A()
@@ -0,0 +1,5 @@
{
"mainFile": "source/A.kt",
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
"targetPackage": "target"
}