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,20 @@
package test
object 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)
}
}
}
@@ -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
}
}
@@ -0,0 +1,9 @@
package test2;
import test.B;
class Test {
B foo() {
return B.INSTANCE;
}
}
@@ -0,0 +1,9 @@
package test2;
import test.B;
class Test {
B foo() {
return B.INSTANCE;
}
}
@@ -0,0 +1,8 @@
package test2
import test.A
import test.B
fun foo(): B {
return B
}
@@ -0,0 +1,7 @@
package test2
import test.B
fun foo(): B {
return B
}
@@ -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
}
object <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)
}
}
}
}
@@ -0,0 +1,9 @@
package test2;
import test.A;
class Test {
A.B foo() {
return A.B.INSTANCE;
}
}
@@ -0,0 +1,9 @@
package test2;
import test.A.B;
class Test {
B foo() {
return B.INSTANCE;
}
}
@@ -0,0 +1,7 @@
package test2
import test.A
fun foo(): A.B {
return A.B
}
@@ -0,0 +1,7 @@
package test2
import test.A.B
fun foo(): B {
return B
}
@@ -0,0 +1,5 @@
{
"mainFile": "test.kt",
"type": "MOVE_KOTLIN_NESTED_CLASS",
"withRuntime": "true"
}