Move: Move refactoring should correct constructor call when moving inner class

#KT-4676 Fixed
This commit is contained in:
Alexey Sedunov
2014-09-09 13:51:23 +04:00
parent feb393e4c8
commit 9b7bccce22
15 changed files with 162 additions and 0 deletions
@@ -0,0 +1,12 @@
package a;
import kotlin.Function0;
public class X {
private A outer;
public X(A outer, Function0<String> f) {
this.outer = outer;
System.out.println(f.invoke());
}
}
@@ -0,0 +1,7 @@
package a
import a.A.*
fun bar(s: String) {
val t: X = X(A()) { s }
}
@@ -0,0 +1,7 @@
package a
import a.X
fun bar(s: String) {
val t: X = X(A()) { s }
}
@@ -0,0 +1,11 @@
package a;
import kotlin.Function0;
public class A {
public class <caret>X {
public X(Function0<String> f) {
System.out.println(f.invoke());
}
}
}
@@ -0,0 +1,7 @@
package a
import a.A.*
fun bar(s: String) {
val t: X = A().X { s }
}
@@ -0,0 +1,7 @@
package a
import a.A.X
fun bar(s: String) {
val t: X = A().X { s }
}
@@ -0,0 +1,7 @@
{
"mainFile": "a/main.java",
"type": "MOVE_INNER_CLASS",
"targetPackage": "a",
"outerInstanceParameterName": "outer",
"withRuntime": "true"
}