[NI] Report unsafe implicit invoke accordingly to OI
There are several issues with unsafe desugaring for convention calls. Proper fix is not implemented here (see design proposal KT-30872). This commit only applies the old logic in the new inference. ^KT-30695 Fixed
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
class MemberInvokeOwner {
|
||||
operator fun invoke() {}
|
||||
}
|
||||
|
||||
class Cls {
|
||||
fun testImplicitReceiver() {
|
||||
<!INAPPLICABLE_CANDIDATE!>nullableExtensionProperty<!>()
|
||||
}
|
||||
}
|
||||
|
||||
val Cls.nullableExtensionProperty: MemberInvokeOwner?
|
||||
get() = null
|
||||
|
||||
val Cls.extensionProperty: MemberInvokeOwner
|
||||
get() = TODO()
|
||||
|
||||
fun testNullableReceiver(nullable: Cls?) {
|
||||
nullable?.extensionProperty()
|
||||
nullable.<!UNRESOLVED_REFERENCE!>extensionProperty<!>()
|
||||
}
|
||||
|
||||
fun testNotNullableReceiver(notNullable: Cls) {
|
||||
notNullable.<!INAPPLICABLE_CANDIDATE!>nullableExtensionProperty<!>()
|
||||
notNullable?.extensionProperty()
|
||||
}
|
||||
Reference in New Issue
Block a user