[NI] Report unsafe implicit invoke accordingly to OI

This reverts commit df046683cc.
KT-30695
This commit is contained in:
Pavel Kirpichenkov
2020-02-13 16:13:53 +03:00
parent 1a2d28d25b
commit b161839092
30 changed files with 286 additions and 62 deletions
@@ -1,4 +1,3 @@
// !WITH_NEW_INFERENCE
//KT-1875 Safe call should be binded with receiver or this object (but not with both by default)
package kt1875
+2 -3
View File
@@ -1,4 +1,3 @@
// !WITH_NEW_INFERENCE
//KT-1875 Safe call should be binded with receiver or this object (but not with both by default)
package kt1875
@@ -10,13 +9,13 @@ interface T {
}
fun test(t: T) {
t<!NI;UNSAFE_CALL!>.<!><!OI;UNSAFE_IMPLICIT_INVOKE_CALL!>f<!>(1) //unsafe call error
t.<!UNSAFE_IMPLICIT_INVOKE_CALL!>f<!>(1) //unsafe call error
t.f?.invoke(1)
}
fun test1(t: T?) {
t<!UNSAFE_CALL!>.<!><!FUNCTION_EXPECTED!>f<!>(1) // todo resolve f as value and report UNSAFE_CALL
t<!NI;UNSAFE_CALL!>?.<!><!OI;UNSAFE_IMPLICIT_INVOKE_CALL!>f<!>(1)
t?.<!UNSAFE_IMPLICIT_INVOKE_CALL!>f<!>(1)
t<!UNSAFE_CALL!>.<!>f?.invoke(1)
t?.f?.invoke(1)
}