Move: Nested classes support
#KT-9027 In Progress
This commit is contained in:
+20
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
+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 B.INSTANCE;
|
||||
}
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return B.INSTANCE;
|
||||
}
|
||||
}
|
||||
+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
|
||||
}
|
||||
+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
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A;
|
||||
|
||||
class Test {
|
||||
A.B foo() {
|
||||
return A.B.INSTANCE;
|
||||
}
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package test2;
|
||||
|
||||
import test.A.B;
|
||||
|
||||
class Test {
|
||||
B foo() {
|
||||
return B.INSTANCE;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
fun foo(): A.B {
|
||||
return A.B
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test2
|
||||
|
||||
import test.A.B
|
||||
|
||||
fun foo(): B {
|
||||
return B
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "test.kt",
|
||||
"type": "MOVE_KOTLIN_NESTED_CLASS",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
Reference in New Issue
Block a user