[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
@@ -0,0 +1,25 @@
class MemberInvokeOwner {
operator fun invoke() {}
}
class Cls {
fun testImplicitReceiver() {
<!UNSAFE_IMPLICIT_INVOKE_CALL!>nullableExtensionProperty<!>()
}
}
val Cls.nullableExtensionProperty: MemberInvokeOwner?
get() = null
val Cls.extensionProperty: MemberInvokeOwner
get() = TODO()
fun testNullableReceiver(nullable: Cls?) {
nullable?.<!UNSAFE_IMPLICIT_INVOKE_CALL!>extensionProperty<!>()
nullable<!UNSAFE_CALL!>.<!><!FUNCTION_EXPECTED!>extensionProperty<!>()
}
fun testNotNullableReceiver(notNullable: Cls) {
notNullable.<!UNSAFE_IMPLICIT_INVOKE_CALL!>nullableExtensionProperty<!>()
notNullable<!UNNECESSARY_SAFE_CALL!>?.<!>extensionProperty()
}