[FIR] Fix missing receiver type if anonymous function without label

This commit is contained in:
simon.ogorodnik
2020-04-07 23:43:42 +03:00
parent d2fd377605
commit f573719cc1
143 changed files with 249 additions and 766 deletions
@@ -11,7 +11,7 @@ fun test() {
} else {
::foo
}
a checkType { <!UNRESOLVED_REFERENCE!>_<!><KFunction0<Int>>() }
a checkType { _<KFunction0<Int>>() }
}
fun foo(): Int = 0
@@ -13,7 +13,7 @@ fun take(f: (A) -> Unit) {}
fun take(f: () -> Unit) {}
fun test() {
B::foo checkType { <!UNRESOLVED_REFERENCE!>_<!><KFunction1<B, Unit>>() }
B::foo checkType { _<KFunction1<B, Unit>>() }
<!INAPPLICABLE_CANDIDATE!>take<!>(B::foo)
}
@@ -11,7 +11,7 @@ class B : A() {
fun test() {
B::foo checkType { <!UNRESOLVED_REFERENCE!>_<!><KFunction2<B, String, String>>() }
B::foo checkType { _<KFunction2<B, String, String>>() }
<!INAPPLICABLE_CANDIDATE!>(B::hashCode)("No.")<!>
}
@@ -1,13 +0,0 @@
// !CHECK_TYPE
import kotlin.reflect.KProperty1
class C {
val baz: Int = 12
}
fun Int.baz() {}
fun test() {
C::baz checkType { <!UNRESOLVED_REFERENCE!>_<!><KProperty1<C, Int>>() }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
import kotlin.reflect.KProperty1
@@ -22,7 +22,7 @@ fun fas(i: Int = 1) {}
fun test() {
<!UNRESOLVED_REFERENCE!>B::foo<!> // todo KT-9601 Chose maximally specific function in callable reference
B::bar checkType { <!UNRESOLVED_REFERENCE!>_<!><KFunction1<B, Unit>>() }
B::bar checkType { _<KFunction1<B, Unit>>() }
<!UNRESOLVED_REFERENCE!>B::bas<!>