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.
28 lines
743 B
Kotlin
28 lines
743 B
Kotlin
// FILE: JavaClass.java
|
|
|
|
public class JavaClass {
|
|
public static final String publicFinal;
|
|
public static volatile Object publicMutable;
|
|
|
|
protected static final double protectedFinal;
|
|
protected static char protectedMutable;
|
|
|
|
private static final JavaClass privateFinal;
|
|
private static Throwable privateMutable;
|
|
}
|
|
|
|
// FILE: test.kt
|
|
|
|
import JavaClass.*
|
|
|
|
import kotlin.reflect.*
|
|
|
|
fun test() {
|
|
::publicFinal : KTopLevelProperty<String>
|
|
::publicMutable : KMutableTopLevelProperty<Any?>
|
|
::protectedFinal : KProperty<Double>
|
|
::protectedMutable : KMutableProperty<Char>
|
|
::<!INVISIBLE_MEMBER!>privateFinal<!> : KProperty<JavaClass?>
|
|
::<!INVISIBLE_MEMBER!>privateMutable<!> : KMutableProperty<Throwable?>
|
|
}
|