[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:
Pavel Kirpichenkov
2020-02-07 18:14:12 +03:00
parent 9d51180202
commit b045adf83a
30 changed files with 286 additions and 62 deletions
@@ -1,4 +1,3 @@
// !WITH_NEW_INFERENCE
// !LANGUAGE: -SafeCastCheckBoundSmartCasts -BooleanElvisBoundSmartCasts
// A set of examples for
// "If the result of a safe call is not null, understand that its receiver is not null"
@@ -1,4 +1,3 @@
// !WITH_NEW_INFERENCE
// !LANGUAGE: -SafeCastCheckBoundSmartCasts -BooleanElvisBoundSmartCasts
// A set of examples for
// "If the result of a safe call is not null, understand that its receiver is not null"
@@ -130,7 +129,7 @@ class Invokable(val x: String) {
class InvokableProperty(val i: Invokable)
fun checkInvokable(ip: InvokableProperty?) {
if (ip?.<!OI;UNSAFE_IMPLICIT_INVOKE_CALL!>i<!>() == "Hello") {
if (ip?.<!UNSAFE_IMPLICIT_INVOKE_CALL!>i<!>() == "Hello") {
<!DEBUG_INFO_SMARTCAST!>ip<!>.hashCode()
}
}