[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
@@ -14,7 +14,7 @@ fun test(t: T) {
}
fun test1(t: T?) {
t.<!UNRESOLVED_REFERENCE!>f<!>(1) // todo resolve f as value and report UNSAFE_CALL
t.<!FUNCTION_EXPECTED!>f<!>(1) // todo resolve f as value and report UNSAFE_CALL
t?.<!UNSAFE_IMPLICIT_INVOKE_CALL!>f<!>(1)
t<!UNSAFE_CALL!>.<!>f?.invoke(1)
t?.f?.invoke(1)
@@ -34,7 +34,7 @@ fun test4() {
// should be an error on receiver, shouldn't be thrown away
fun test5() {
1.(<!UNRESOLVED_REFERENCE!>fun String.()=1<!>)()
1.(<!FUNCTION_EXPECTED!>fun String.()=1<!>)()
}
fun <R: Any> R?.sure() : R = this!!