IfThenToSafeAccessInspection: do not report if condition is SENSELESS_COMPARISON/USELESS_IS_CHECK (#3007)
#KT-36051 Fixed
This commit is contained in:
committed by
GitHub
parent
122bba9102
commit
d965ad0a98
+1
@@ -1,3 +1,4 @@
|
||||
// PROBLEM: none
|
||||
class Foo
|
||||
|
||||
class Bar {
|
||||
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
class Foo
|
||||
|
||||
class Bar {
|
||||
fun Foo?.test() {
|
||||
this@Bar?.bar()
|
||||
}
|
||||
fun bar() {}
|
||||
}
|
||||
-9
@@ -136,15 +136,6 @@
|
||||
<problem_class severity="INFO" attribute_key="INFO_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>implicitReceiver3.kt</file>
|
||||
<line>5</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<package><default></package>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/implicitReceiver3.kt" />
|
||||
<problem_class severity="INFO" attribute_key="INFO_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
|
||||
<description>Foldable if-then</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>resultCall.kt</file>
|
||||
<line>6</line>
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// PROBLEM: none
|
||||
fun test(foo: Foo) {
|
||||
<caret>if (foo != null) {
|
||||
foo.bar()
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
fun bar() {}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// PROBLEM: none
|
||||
fun test(foo: Foo) {
|
||||
<caret>if (foo is Foo) {
|
||||
foo.bar()
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
fun bar() {}
|
||||
}
|
||||
Reference in New Issue
Block a user