mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
Basic reflection is usable without any imports (with :: literals)
This reverts commit 9503056dd5.
18 lines
304 B
Kotlin
18 lines
304 B
Kotlin
import kotlin.reflect.*
|
|
|
|
class A {
|
|
fun foo() {}
|
|
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
|
fun baz() = "OK"
|
|
}
|
|
|
|
fun main() {
|
|
val x = A::foo
|
|
val y = A::bar
|
|
val z = A::baz
|
|
|
|
x : KMemberFunction0<A, Unit>
|
|
y : KMemberFunction1<A, Int, Unit>
|
|
z : KMemberFunction0<A, String>
|
|
}
|