Move: Nested classes support

#KT-9027 In Progress
This commit is contained in:
Alexey Sedunov
2016-01-12 20:41:02 +03:00
parent 0304bd1dc1
commit d662b02e95
159 changed files with 2588 additions and 197 deletions
@@ -0,0 +1,25 @@
package test3
import test.A
class D {
class C {
fun test() {
A.B.X()
A.B.Companion.Y()
A.B.foo(A.B.bar)
//1.extFoo(1.extBar) // conflict
A.B.O.Y()
A.B.O.foo(A.B.O.bar)
with (A.B.O) {
A.B.Companion.Y()
foo(bar)
1.extFoo(1.extBar)
}
}
}
}
@@ -0,0 +1,36 @@
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
}
}
}
@@ -0,0 +1,9 @@
package test2;
import test3.D;
class Test {
D.C foo() {
return new D.C();
}
}
@@ -0,0 +1,9 @@
package test2;
import test3.D.C;
class Test {
C foo() {
return new C();
}
}
@@ -0,0 +1,9 @@
package test2;
import test3.D;
class Test {
D.C foo() {
return new D.C();
}
}
@@ -0,0 +1,8 @@
package test2
import test.A
import test3.D
fun foo(): D.C {
return D.C()
}
@@ -0,0 +1,7 @@
package test2
import test3.D.C
fun foo(): C {
return C()
}
@@ -0,0 +1,8 @@
package test2
import test.A.B
import test3.D
fun foo(): D.C {
return D.C()
}
@@ -0,0 +1,5 @@
package test3
class D {
}
@@ -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)
}
}
}
}
}
@@ -0,0 +1,9 @@
package test2;
import test.A;
class Test {
A.B.C foo() {
return new A.B.C();
}
}
@@ -0,0 +1,9 @@
package test2;
import test.A.B.C;
class Test {
C foo() {
return new C();
}
}
@@ -0,0 +1,9 @@
package test2;
import test.A.B;
class Test {
B.C foo() {
return new B.C();
}
}
@@ -0,0 +1,7 @@
package test2
import test.A
fun foo(): A.B.C {
return A.B.C()
}
@@ -0,0 +1,7 @@
package test2
import test.A.B.C
fun foo(): C {
return C()
}
@@ -0,0 +1,7 @@
package test2
import test.A.B
fun foo(): B.C {
return B.C()
}
@@ -0,0 +1,6 @@
{
"mainFile": "test.kt",
"type": "MOVE_KOTLIN_NESTED_CLASS",
"targetClass": "test3.D",
"withRuntime": "true"
}