[FIR] Fix callable references to fields / parameters / etc.

Before this commit, only references to functions & properties
were possible, now fields & parameters are also supported
This commit is contained in:
Mikhail Glukhikh
2020-01-22 11:50:57 +03:00
parent c37394ec83
commit 2086c34cb9
12 changed files with 57 additions and 29 deletions
@@ -17,10 +17,10 @@ public class JavaClass {
import kotlin.reflect.*
fun test() {
val pubFinRef: KProperty1<JavaClass, Int> = <!UNRESOLVED_REFERENCE!>JavaClass::publicFinal<!>
val pubMutRef: KMutableProperty1<JavaClass, Long> = <!UNRESOLVED_REFERENCE!>JavaClass::publicMutable<!>
val protFinRef: KProperty1<JavaClass, Double> = <!UNRESOLVED_REFERENCE!>JavaClass::protectedFinal<!>
val protMutRef: KMutableProperty1<JavaClass, Char> = <!UNRESOLVED_REFERENCE!>JavaClass::protectedMutable<!>
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<!>
}
@@ -19,10 +19,10 @@ import JavaClass.*
import kotlin.reflect.*
fun test() {
val pubFinRef: KProperty0<String> = <!UNRESOLVED_REFERENCE!>::publicFinal<!>
val pubMutRef: KMutableProperty0<Any?> = <!UNRESOLVED_REFERENCE!>::publicMutable<!>
val protFinRef: KProperty<Double> = <!UNRESOLVED_REFERENCE!>::protectedFinal<!>
val protMutRef: KMutableProperty<Char> = <!UNRESOLVED_REFERENCE!>::protectedMutable<!>
val pubFinRef: KProperty0<String> = ::publicFinal
val pubMutRef: KMutableProperty0<Any?> = ::publicMutable
val protFinRef: KProperty<Double> = ::protectedFinal
val protMutRef: KMutableProperty<Char> = ::protectedMutable
val privFinRef: KProperty<JavaClass?> = <!UNRESOLVED_REFERENCE!>::privateFinal<!>
val privMutRef: KMutableProperty<Throwable?> = <!UNRESOLVED_REFERENCE!>::privateMutable<!>
}
@@ -3,7 +3,7 @@
fun eat(value: Any) {}
fun test(param: String) {
val a = <!UNRESOLVED_REFERENCE!>::param<!>
val a = ::param
val local = "local"
val b = ::local