Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/callableReference/property/memberFromTopLevel.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

24 lines
476 B
Kotlin

import kotlin.reflect.*
class A {
val foo: Int = 42
var bar: String = ""
}
fun test() {
val p = A::foo
p : KMemberProperty<A, Int>
<!TYPE_MISMATCH!>p<!> : KMutableMemberProperty<A, Int>
p.get(A()) : Int
p.get(<!NO_VALUE_FOR_PARAMETER!>)<!>
p.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>set<!>(A(), 239)
val q = A::bar
q : KMemberProperty<A, String>
q : KMutableMemberProperty<A, String>
q.get(A()): String
q.set(A(), "q")
}