Revert "IfThenToSafeAccessInspection: fix it works correctly for variable/operator call"

This reverts commit 5095caee
This commit is contained in:
Yan Zhulanow
2020-10-24 00:18:32 +09:00
parent 19896f9616
commit 19f518c037
11 changed files with 2 additions and 107 deletions
@@ -1,8 +0,0 @@
// HIGHLIGHT: INFORMATION
fun test(foo: Foo?) {
<caret>if (foo != null) foo()
}
class Foo {
operator fun invoke() {}
}
@@ -1,8 +0,0 @@
// HIGHLIGHT: INFORMATION
fun test(foo: Foo?) {
foo?.invoke()
}
class Foo {
operator fun invoke() {}
}
@@ -1,11 +0,0 @@
class Foo(val bar: Bar)
class Bar {
operator fun invoke() {}
}
fun test(foo: Foo?) {
<caret>if (foo != null) {
foo.bar()
}
}
@@ -1,9 +0,0 @@
class Foo(val bar: Bar)
class Bar {
operator fun invoke() {}
}
fun test(foo: Foo?) {
foo?.bar?.invoke()
}
@@ -1,4 +0,0 @@
// HIGHLIGHT: INFORMATION
fun test(foo: (() -> Unit)?) {
<caret>if (foo != null) foo()
}
@@ -1,4 +0,0 @@
// HIGHLIGHT: INFORMATION
fun test(foo: (() -> Unit)?) {
foo?.invoke()
}
@@ -1,7 +0,0 @@
class Foo(val f: () -> Unit)
fun test(foo: Foo?) {
<caret>if (foo != null) {
foo.f()
}
}
@@ -1,5 +0,0 @@
class Foo(val f: () -> Unit)
fun test(foo: Foo?) {
foo?.f?.invoke()
}