mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 08:31:28 +00:00
Basic reflection is usable without any imports (with :: literals)
This reverts commit 9503056dd5.
26 lines
789 B
Kotlin
26 lines
789 B
Kotlin
// FILE: JavaClass.java
|
|
|
|
public class JavaClass {
|
|
public final int publicFinal;
|
|
public long publicMutable;
|
|
|
|
protected final double protectedFinal;
|
|
protected char protectedMutable;
|
|
|
|
private final String privateFinal;
|
|
private Object privateMutable;
|
|
}
|
|
|
|
// FILE: test.kt
|
|
|
|
import kotlin.reflect.*
|
|
|
|
fun test() {
|
|
JavaClass::publicFinal : KMemberProperty<JavaClass, Int>
|
|
JavaClass::publicMutable : KMutableMemberProperty<JavaClass, Long>
|
|
JavaClass::protectedFinal : KMemberProperty<JavaClass, Double>
|
|
JavaClass::protectedMutable : KMutableMemberProperty<JavaClass, Char>
|
|
JavaClass::<!INVISIBLE_MEMBER!>privateFinal<!> : KMemberProperty<JavaClass, String?>
|
|
JavaClass::<!INVISIBLE_MEMBER!>privateMutable<!> : KMutableMemberProperty<JavaClass, Any?>
|
|
}
|