Files
kotlin/idea/testData/multiFileIntentions/moveToCompanion/moveFunction/before/test.kt
Alexey Sedunov d13ac6b5a4 Intentions: Move class member to companion object
#KT-9697 In Progress
2016-02-04 12:26:18 +03:00

62 lines
875 B
Kotlin
Vendored

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
}
fun <caret>test(n: Int) {
X()
Y()
foo(bar)
1.extFoo(1.extBar)
OuterY()
outerFoo(outerBar)
this.OuterY()
this.outerFoo(this@A.outerBar)
O.Y()
O.foo(O.bar)
with (O) {
Y()
foo(bar)
1.extFoo(1.extBar)
}
}
}