[FIR] Implement FUNCTION_EXPECTED

This commit is contained in:
Ivan Kochurkin
2021-06-29 22:06:44 +03:00
parent 263e40e753
commit 2574dc907c
32 changed files with 146 additions and 58 deletions
@@ -1,5 +1,5 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION
fun foo(i: Int) {
<!UNRESOLVED_REFERENCE!>i<!>()
<!UNRESOLVED_REFERENCE!>1<!>()
}
<!FUNCTION_EXPECTED!>1<!>()
}
@@ -1,7 +1,7 @@
fun test1() {
1. (<!UNRESOLVED_REFERENCE!>fun String.(i: Int) = i<!> )(1)
1.(<!UNRESOLVED_REFERENCE!>label@ fun String.(i: Int) = i<!> )(1)
1. (<!FUNCTION_EXPECTED!>fun String.(i: Int) = i<!> )(1)
1.(<!FUNCTION_EXPECTED!>label@ fun String.(i: Int) = i<!> )(1)
}
fun test2(f: String.(Int) -> Unit) {
@@ -12,5 +12,5 @@ fun test2(f: String.(Int) -> Unit) {
fun test3() {
fun foo(): String.(Int) -> Unit = {}
1.(<!UNRESOLVED_REFERENCE!>foo()<!>)(1)
1.(<!FUNCTION_EXPECTED!>foo()<!>)(1)
}
@@ -2,11 +2,11 @@ class A(val x: (String.() -> Unit)?)
fun test(a: A) {
if (a.x != null) {
"".(<!UNRESOLVED_REFERENCE!>a.x<!>)()
"".(<!FUNCTION_EXPECTED!>a.x<!>)()
a.x("") // todo
(a.x)("")
}
"".(<!UNRESOLVED_REFERENCE!>a.x<!>)()
"".(<!FUNCTION_EXPECTED!>a.x<!>)()
a.<!UNSAFE_IMPLICIT_INVOKE_CALL!>x<!>("")
<!UNSAFE_IMPLICIT_INVOKE_CALL!>(a.x)<!>("")
@@ -26,7 +26,7 @@ val Cls.extensionProperty: MemberInvokeOwner
fun testNullableReceiver(nullable: Cls?) {
nullable?.extensionProperty()
nullable.<!UNRESOLVED_REFERENCE!>extensionProperty<!>()
nullable.<!FUNCTION_EXPECTED!>extensionProperty<!>()
}
fun testNotNullableReceiver(notNullable: Cls) {