Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/property/javaInstanceField.fir.kt
T
Mikhail Glukhikh 2086c34cb9 [FIR] Fix callable references to fields / parameters / etc.
Before this commit, only references to functions & properties
were possible, now fields & parameters are also supported
2020-01-23 12:32:40 +03:00

27 lines
894 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?> = <!UNRESOLVED_REFERENCE!>JavaClass::privateFinal<!>
val privMutRef: KMutableProperty1<JavaClass, Any?> = <!UNRESOLVED_REFERENCE!>JavaClass::privateMutable<!>
}