mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 15:53:46 +00:00
Basic reflection is usable without any imports (with :: literals)
This reverts commit 9503056dd5.
30 lines
425 B
Kotlin
30 lines
425 B
Kotlin
// FILE: a.kt
|
|
|
|
package other
|
|
|
|
fun foo() {}
|
|
|
|
class A {
|
|
fun bar() = 42
|
|
}
|
|
|
|
fun A.baz(<!UNUSED_PARAMETER!>x<!>: String) {}
|
|
|
|
// FILE: b.kt
|
|
|
|
import kotlin.reflect.*
|
|
|
|
import other.foo as foofoo
|
|
import other.A as AA
|
|
import other.baz as bazbaz
|
|
|
|
fun main() {
|
|
val x = ::foofoo
|
|
val y = AA::bar
|
|
val z = AA::bazbaz
|
|
|
|
x : KFunction0<Unit>
|
|
y : KMemberFunction0<AA, Int>
|
|
z : KExtensionFunction1<AA, String, Unit>
|
|
}
|