Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/callableReference/property/memberFromExtension.kt
T
Alexander Udalov a38a396a43 Remove default import "kotlin.reflect"
Basic reflection is usable without any imports (with :: literals)

This reverts commit 9503056dd5.
2014-07-02 01:55:53 +04:00

22 lines
389 B
Kotlin

import kotlin.reflect.*
class A {
val foo: Unit = Unit.VALUE
var bar: String = ""
var self: A
get() = this
set(value) { }
}
fun A.test() {
val x = ::foo
val y = ::bar
val z = ::self
x : KMemberProperty<A, Unit>
y : KMutableMemberProperty<A, String>
z : KMutableMemberProperty<A, A>
y.set(z.get(A()), x.get(A()).toString())
}