30794060a9
Leave only 3*2 = 6 classes: KProperty0, KProperty1, KProperty2 and their mutable analogs, depending on the number of receivers a property takes
27 lines
886 B
Kotlin
Vendored
27 lines
886 B
Kotlin
Vendored
// !DIAGNOSTICS:-UNUSED_VARIABLE
|
|
// 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() {
|
|
val pubFinRef: KProperty1<JavaClass, Int> = JavaClass::publicFinal
|
|
val pubMutRef: KMutableProperty1<JavaClass, Long> = JavaClass::publicMutable
|
|
val protFinRef: KProperty1<JavaClass, Double> = JavaClass::protectedFinal
|
|
val protMutRef: KMutableProperty1<JavaClass, Char> = JavaClass::protectedMutable
|
|
val privFinRef: KProperty1<JavaClass, String?> = JavaClass::<!INVISIBLE_MEMBER!>privateFinal<!>
|
|
val privMutRef: KMutableProperty1<JavaClass, Any?> = JavaClass::<!INVISIBLE_MEMBER!>privateMutable<!>
|
|
}
|