Move: Nested classes support
#KT-9027 In Progress
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class A {
|
||||
inner class OuterOuterY
|
||||
|
||||
inner class B {
|
||||
inner class C {
|
||||
fun test() {
|
||||
OuterOuterY()
|
||||
this@A.OuterOuterY()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
class A {
|
||||
inner class OuterOuterY
|
||||
|
||||
inner class B {
|
||||
inner class <caret>C {
|
||||
fun test() {
|
||||
OuterOuterY()
|
||||
this@A.OuterOuterY()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Indirect outer instances won't be extracted: OuterOuterY()
|
||||
Indirect outer instances won't be extracted: this@A
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"mainFile": "test.kt",
|
||||
"type": "MOVE_KOTLIN_NESTED_CLASS",
|
||||
"outerInstanceParameter": "a",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
package test
|
||||
|
||||
class C(private val b: A.B) {
|
||||
fun test() {
|
||||
A.X()
|
||||
|
||||
A.Companion.Y()
|
||||
A.foo(A.bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
b.OuterY()
|
||||
b.outerFoo(b.outerBar)
|
||||
|
||||
b.OuterY()
|
||||
b.outerFoo(b.outerBar)
|
||||
|
||||
A.O.Y()
|
||||
A.O.foo(A.O.bar)
|
||||
|
||||
with (A.O) {
|
||||
A.Companion.Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
inner class B {
|
||||
inner class OuterY
|
||||
|
||||
fun outerFoo(n: Int) {}
|
||||
|
||||
val outerBar = 1
|
||||
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C(new A().new B());
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C(new A().new B());
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C(new A().new B());
|
||||
}
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.C
|
||||
|
||||
fun foo(): C {
|
||||
return C(A().B())
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.C
|
||||
|
||||
fun foo2(): C {
|
||||
return C(A().B())
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.A.B
|
||||
import test.C
|
||||
|
||||
fun foo2(): C {
|
||||
return C(A().B())
|
||||
}
|
||||
Vendored
+66
@@ -0,0 +1,66 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
inner class B {
|
||||
inner class OuterY
|
||||
|
||||
fun outerFoo(n: Int) {}
|
||||
|
||||
val outerBar = 1
|
||||
|
||||
inner class <caret>C {
|
||||
fun test() {
|
||||
X()
|
||||
|
||||
Y()
|
||||
foo(bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
OuterY()
|
||||
outerFoo(outerBar)
|
||||
|
||||
this@B.OuterY()
|
||||
this@B.outerFoo(this@B.outerBar)
|
||||
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.B.C foo() {
|
||||
return new A().new B().new C();
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.A.B.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new A().new B().new C();
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.A.B;
|
||||
|
||||
class Test {
|
||||
B.C foo() {
|
||||
return new A().new B().new C();
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
fun foo(): A.B.C {
|
||||
return A().B().C()
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.A.B.C
|
||||
|
||||
fun foo2(): C {
|
||||
return A().B().C()
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.A.B
|
||||
|
||||
fun foo2(): B.C {
|
||||
return A().B().C()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"mainFile": "test.kt",
|
||||
"type": "MOVE_KOTLIN_NESTED_CLASS",
|
||||
"outerInstanceParameter": "b",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
class C {
|
||||
fun test() {
|
||||
A.X()
|
||||
|
||||
A.Companion.Y()
|
||||
A.foo(A.bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
A.O.Y()
|
||||
A.O.foo(A.O.bar)
|
||||
|
||||
with (A.O) {
|
||||
A.Companion.Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
class B {
|
||||
}
|
||||
}
|
||||
idea/testData/refactoring/move/kotlin/moveNestedClass/deepNonInnerToTopLevel/after/test2/usages.java
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C();
|
||||
}
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.C
|
||||
|
||||
fun foo(): C {
|
||||
return C()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.C
|
||||
|
||||
fun foo(): C {
|
||||
return C()
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A.B
|
||||
import test.C
|
||||
|
||||
fun foo(): C {
|
||||
return C()
|
||||
}
|
||||
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
class B {
|
||||
class <caret>C {
|
||||
fun test() {
|
||||
X()
|
||||
|
||||
Y()
|
||||
foo(bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.B.C foo() {
|
||||
return new A.B.C();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A.B.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A.B;
|
||||
|
||||
class Test {
|
||||
B.C foo() {
|
||||
return new B.C();
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
fun foo(): A.B.C {
|
||||
return A.B.C()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A.B.C
|
||||
|
||||
fun foo(): C {
|
||||
return C()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A.B
|
||||
|
||||
fun foo(): B.C {
|
||||
return B.C()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "test.kt",
|
||||
"type": "MOVE_KOTLIN_NESTED_CLASS",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
class B {
|
||||
fun test() {
|
||||
A.X()
|
||||
|
||||
A.Companion.Y()
|
||||
A.foo(A.bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
A.O.Y()
|
||||
A.O.foo(A.O.bar)
|
||||
|
||||
with (A.O) {
|
||||
A.Companion.Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return new A().new B();
|
||||
}
|
||||
}
|
||||
idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/after/test2/usages2.java
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return new A().new B();
|
||||
}
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.B
|
||||
|
||||
fun foo(): B {
|
||||
return B()
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.B
|
||||
|
||||
fun foo2(): B {
|
||||
return B()
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
inner class <caret>B {
|
||||
fun test() {
|
||||
X()
|
||||
|
||||
Y()
|
||||
foo(bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
idea/testData/refactoring/move/kotlin/moveNestedClass/innerToTopLevelNoThis/before/test2/usages.java
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.B foo() {
|
||||
return new A().new B();
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.A.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return new A().new B();
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
fun foo(): A.B {
|
||||
return A().B()
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.A.B
|
||||
|
||||
fun foo2(): B {
|
||||
return A().B()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "test.kt",
|
||||
"type": "MOVE_KOTLIN_NESTED_CLASS",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package test
|
||||
|
||||
class B(private val a: A) {
|
||||
fun test() {
|
||||
A.X()
|
||||
|
||||
A.Companion.Y()
|
||||
A.foo(A.bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
a.OuterY()
|
||||
a.outerFoo(a.outerBar)
|
||||
|
||||
a.OuterY()
|
||||
a.outerFoo(a.outerBar)
|
||||
|
||||
A.O.Y()
|
||||
A.O.foo(A.O.bar)
|
||||
|
||||
with (A.O) {
|
||||
A.Companion.Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
inner class OuterY
|
||||
|
||||
fun outerFoo(n: Int) {}
|
||||
|
||||
val outerBar = 1
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return new B(new A());
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return new B(new A());
|
||||
}
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.B
|
||||
|
||||
fun foo(): B {
|
||||
return B(A())
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.B
|
||||
|
||||
fun foo2(): B {
|
||||
return B(A())
|
||||
}
|
||||
Vendored
+64
@@ -0,0 +1,64 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
inner class OuterY
|
||||
|
||||
fun outerFoo(n: Int) {}
|
||||
|
||||
val outerBar = 1
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
inner class <caret>B {
|
||||
fun test() {
|
||||
X()
|
||||
|
||||
Y()
|
||||
foo(bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
OuterY()
|
||||
outerFoo(outerBar)
|
||||
|
||||
this@A.OuterY()
|
||||
this@A.outerFoo(this@A.outerBar)
|
||||
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.B foo() {
|
||||
return new A().new B();
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
import test.A.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return new A().new B();
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
fun foo(): A.B {
|
||||
return A().B()
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.A.B
|
||||
|
||||
fun foo2(): B {
|
||||
return A().B()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"mainFile": "test.kt",
|
||||
"type": "MOVE_KOTLIN_NESTED_CLASS",
|
||||
"outerInstanceParameter": "a",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A() {
|
||||
fun X.bar() {}
|
||||
}
|
||||
|
||||
class X {
|
||||
fun Int.foo() {}
|
||||
|
||||
inner class Y {
|
||||
fun test() {
|
||||
1.foo()
|
||||
with(1) { foo() }
|
||||
with(A()) { bar() }
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A() {
|
||||
fun X.bar() {}
|
||||
}
|
||||
|
||||
class X {
|
||||
fun Int.foo() {}
|
||||
|
||||
inner class <caret>Y {
|
||||
fun test() {
|
||||
1.foo()
|
||||
with(1) { foo() }
|
||||
with(A()) { bar() }
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
Call with two implicit receivers won't be processed: bar()
|
||||
Call with two implicit receivers won't be processed: foo()
|
||||
Qualified call won't be processed: 1.foo()
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"mainFile": "test.kt",
|
||||
"type": "MOVE_KOTLIN_NESTED_CLASS",
|
||||
"outerInstanceParameter": "a",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class B {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class C {
|
||||
fun test() {
|
||||
B.X()
|
||||
|
||||
B.Companion.Y()
|
||||
B.foo(B.bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
B.O.Y()
|
||||
B.O.foo(B.O.bar)
|
||||
|
||||
with (B.O) {
|
||||
B.Companion.Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.C foo() {
|
||||
return new A.C();
|
||||
}
|
||||
}
|
||||
idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToOuterClass1/after/test2/usages2.java
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C();
|
||||
}
|
||||
}
|
||||
idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToOuterClass1/after/test2/usages3.java
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.C foo() {
|
||||
return new A.C();
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
fun foo(): A.C {
|
||||
return A.C()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A.C
|
||||
|
||||
fun foo(): C {
|
||||
return C()
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.A.B
|
||||
|
||||
fun foo(): A.C {
|
||||
return A.C()
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class B {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
class <caret>C {
|
||||
fun test() {
|
||||
X()
|
||||
|
||||
Y()
|
||||
foo(bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToOuterClass1/before/test2/usages.java
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.B.C foo() {
|
||||
return new A.B.C();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A.B.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A.B;
|
||||
|
||||
class Test {
|
||||
B.C foo() {
|
||||
return new B.C();
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
fun foo(): A.B.C {
|
||||
return A.B.C()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A.B.C
|
||||
|
||||
fun foo(): C {
|
||||
return C()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A.B
|
||||
|
||||
fun foo(): B.C {
|
||||
return B.C()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"mainFile": "test.kt",
|
||||
"type": "MOVE_KOTLIN_NESTED_CLASS",
|
||||
"targetClass": "test.A",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
class B {
|
||||
}
|
||||
|
||||
class C {
|
||||
fun test() {
|
||||
X()
|
||||
|
||||
Y()
|
||||
foo(bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.C foo() {
|
||||
return new A.C();
|
||||
}
|
||||
}
|
||||
idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToOuterClass2/after/test2/usages2.java
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C();
|
||||
}
|
||||
}
|
||||
idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToOuterClass2/after/test2/usages3.java
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.C foo() {
|
||||
return new A.C();
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
fun foo(): A.C {
|
||||
return A.C()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A.C
|
||||
|
||||
fun foo(): C {
|
||||
return C()
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.A.B
|
||||
|
||||
fun foo(): A.C {
|
||||
return A.C()
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
class B {
|
||||
class <caret>C {
|
||||
fun test() {
|
||||
X()
|
||||
|
||||
Y()
|
||||
foo(bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
O.Y()
|
||||
O.foo(O.bar)
|
||||
|
||||
with (O) {
|
||||
Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
idea/testData/refactoring/move/kotlin/moveNestedClass/nonInnerToOuterClass2/before/test2/usages.java
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.B.C foo() {
|
||||
return new A.B.C();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A.B.C;
|
||||
|
||||
class Test {
|
||||
C foo() {
|
||||
return new C();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A.B;
|
||||
|
||||
class Test {
|
||||
B.C foo() {
|
||||
return new B.C();
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
fun foo(): A.B.C {
|
||||
return A.B.C()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A.B.C
|
||||
|
||||
fun foo(): C {
|
||||
return C()
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A.B
|
||||
|
||||
fun foo(): B.C {
|
||||
return B.C()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"mainFile": "test.kt",
|
||||
"type": "MOVE_KOTLIN_NESTED_CLASS",
|
||||
"targetClass": "test.A",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
class B {
|
||||
fun test() {
|
||||
A.X()
|
||||
|
||||
A.Companion.Y()
|
||||
A.foo(A.bar)
|
||||
//1.extFoo(1.extBar) // conflict
|
||||
|
||||
A.O.Y()
|
||||
A.O.foo(A.O.bar)
|
||||
|
||||
with (A.O) {
|
||||
A.Companion.Y()
|
||||
foo(bar)
|
||||
1.extFoo(1.extBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package test
|
||||
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|
||||
|
||||
class A {
|
||||
class X {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
object O {
|
||||
class Y
|
||||
|
||||
fun foo(n: Int) {}
|
||||
|
||||
val bar = 1
|
||||
|
||||
fun Int.extFoo(n: Int) {}
|
||||
|
||||
val Int.extBar: Int get() = 1
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return new B();
|
||||
}
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return new B();
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
import test.B
|
||||
|
||||
fun foo(): B {
|
||||
return B()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.B
|
||||
|
||||
fun foo(): B {
|
||||
return B()
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user